summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-05-07 01:58:36 +0300
committerAndrei Karas <akaras@inbox.ru>2018-05-07 01:58:36 +0300
commit7913084817a6c6a18b1125cb8794210d56ec90b6 (patch)
tree04e8509ba59140d7c7ba0e86638330769e15ce1d
parent93af795aaf20c0936e59c88237cab850f5fcfb9b (diff)
downloadplus-7913084817a6c6a18b1125cb8794210d56ec90b6.tar.gz
plus-7913084817a6c6a18b1125cb8794210d56ec90b6.tar.bz2
plus-7913084817a6c6a18b1125cb8794210d56ec90b6.tar.xz
plus-7913084817a6c6a18b1125cb8794210d56ec90b6.zip
Improve a bit scrollarea.
-rw-r--r--src/gui/widgets/scrollarea.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index fba51e882..52372c385 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -1061,9 +1061,8 @@ Rect ScrollArea::getVerticalMarkerDimension()
if (length > height)
length = height;
- const int maxScroll = getVerticalMaxScroll();
- if (maxScroll != 0)
- pos = ((height - length) * mVScroll) / maxScroll;
+ if (maxV != 0)
+ pos = ((height - length) * mVScroll) / maxV;
else
pos = 0;
}
@@ -1093,7 +1092,7 @@ Rect ScrollArea::getHorizontalMarkerDimension()
width = mDimension.width - w2 - mScrollbarWidth;
const int maxH = getHorizontalMaxScroll();
- if ((mMarkerSize != 0) && (maxH != 0))
+ if (mMarkerSize != 0 && maxH != 0)
{
pos = (mHScroll * width / maxH - mMarkerSize / 2);
length = mMarkerSize;
@@ -1119,10 +1118,9 @@ Rect ScrollArea::getHorizontalMarkerDimension()
if (length > width)
length = width;
- if (getHorizontalMaxScroll() != 0)
+ if (maxH != 0)
{
- pos = ((width - length) * mHScroll)
- / getHorizontalMaxScroll();
+ pos = ((width - length) * mHScroll) / maxH;
}
else
{