diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
commit | 1e2a88e975019929c4c7e3154537865cc09550a6 (patch) | |
tree | ae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/gui/widgets/scrollarea.cpp | |
parent | 6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff) | |
download | ManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz ManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2 ManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz ManaVerse-1e2a88e975019929c4c7e3154537865cc09550a6.zip |
Fix some code style issues
Diffstat (limited to 'src/gui/widgets/scrollarea.cpp')
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 27e21593d..172461e64 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -457,14 +457,13 @@ void ScrollArea::drawFrame(Graphics *const graphics) BLOCK_START("ScrollArea::drawFrame") if (mOpaque == Opaque_true) { - const int bs = mFrameSize * 2; - const int w = mDimension.width + bs; - const int h = mDimension.height + bs; - updateCalcFlag(graphics); if (mRedraw) { + const int bs = mFrameSize * 2; + const int w = mDimension.width + bs; + const int h = mDimension.height + bs; mVertexes2->clear(); graphics->calcWindow(mVertexes2, 0, 0, @@ -759,10 +758,10 @@ void ScrollArea::mouseExited(MouseEvent& event A_UNUSED) void ScrollArea::widgetResized(const Event &event A_UNUSED) { mRedraw = true; - const unsigned int frameSize = 2 * mFrameSize; Widget *const content = getContent(); if (content != nullptr) { + const unsigned int frameSize = 2 * mFrameSize; content->setSize(mDimension.width - frameSize, mDimension.height - frameSize); } @@ -935,13 +934,12 @@ void ScrollArea::mouseDragged(MouseEvent &event) if (mIsVerticalMarkerDragged) { const Rect barDim = getVerticalBarDimension(); - - const int pos = event.getY() - barDim.y - - mVerticalMarkerDragOffset; const int length = getVerticalMarkerDimension().height; if ((barDim.height - length) > 0) { + const int pos = event.getY() - barDim.y + - mVerticalMarkerDragOffset; setVerticalScrollAmount((getVerticalMaxScroll() * pos) / (barDim.height - length)); } @@ -954,13 +952,12 @@ void ScrollArea::mouseDragged(MouseEvent &event) if (mIsHorizontalMarkerDragged) { const Rect barDim = getHorizontalBarDimension(); - - const int pos = event.getX() - barDim.x - - mHorizontalMarkerDragOffset; const int length = getHorizontalMarkerDimension().width; if ((barDim.width - length) > 0) { + const int pos = event.getX() - barDim.x + - mHorizontalMarkerDragOffset; setHorizontalScrollAmount((getHorizontalMaxScroll() * pos) / (barDim.width - length)); } |