aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
diff options
context:
space:
mode:
authorJoni Poikelin <joni.poikelin@theqtcompany.com>2016-03-30 10:46:59 +0300
committerJoni Poikelin <joni.poikelin@theqtcompany.com>2016-04-01 07:35:38 +0000
commitbed6b3d633d83302a8e2167845db4b36e6847f0b (patch)
tree761e59bd982090979e8ff8098a4a79ea90d8f05e /src/templates
parentc59c43bbc44026a508746b1de2505f6185bd0310 (diff)
Fix ScrollBars with paddings
Padding was not taken into account when calculating the new position, which caused there to be small offset between the mouse press and the resulting handle position by the amount of padding used. Task-number: QTBUG-52233 Change-Id: Ibd8c4375b030a27a6124aefc4bc9af570d14d3a9 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/qquickscrollbar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/templates/qquickscrollbar.cpp b/src/templates/qquickscrollbar.cpp
index 86d4e290..b3679bf8 100644
--- a/src/templates/qquickscrollbar.cpp
+++ b/src/templates/qquickscrollbar.cpp
@@ -285,9 +285,9 @@ qreal QQuickScrollBar::positionAt(const QPoint &point) const
{
Q_D(const QQuickScrollBar);
if (d->orientation == Qt::Horizontal)
- return point.x() / width();
+ return (point.x() - leftPadding()) / availableWidth();
else
- return point.y() / height();
+ return (point.y() - topPadding()) / availableHeight();
}
#ifndef QT_NO_ACCESSIBILITY