Update the lastPosition with the full current position
authorAllan Sandfeld Jensen <allan.jensen@nokia.com>
Mon, 9 Jan 2012 11:31:45 +0000 (12:31 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 9 Jan 2012 21:03:22 +0000 (22:03 +0100)
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 <robert.griebl@nokia.com>
src/widgets/util/qscroller.cpp

index 1905cf5..fac6809 100644 (file)
@@ -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;
 }