From aa23a18ad2d74232818aa70054b4a179a7a78dbb Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 9 Jan 2012 12:31:45 +0100 Subject: Update the lastPosition with the full current position By only updating parts of the lastPosition the axislock got confused, since the direction would be calculated from a mix of delta-movement and movements since touch begin. Task-Number: QTBUG-23530 Change-Id: I6b886d4819b963aba18bb86154df172070399206 Reviewed-by: Robert Griebl --- src/widgets/util/qscroller.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/widgets/util') diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index 1905cf5701..fac6809ac6 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -1524,10 +1524,8 @@ void QScrollerPrivate::handleDrag(const QPointF &position, qint64 timestamp) dragDistance += deltaPixel; // } //qScrollerDebug() << "######################" << deltaPixel << position.y() << lastPosition.y(); - if (canScrollX) - lastPosition.setX(position.x()); - if (canScrollY) - lastPosition.setY(position.y()); + + lastPosition = position; lastTimestamp = timestamp; } -- cgit v1.2.3