From bed6b3d633d83302a8e2167845db4b36e6847f0b Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Wed, 30 Mar 2016 10:46:59 +0300 Subject: 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 --- src/templates/qquickscrollbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/templates/qquickscrollbar.cpp') 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 -- cgit v1.2.3