summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den.exter@jollamobile.com>2013-03-12 06:04:54 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-11 02:05:46 (GMT)
commit7b18c792d0575901d403e475472b9632280f54e7 (patch)
tree256505072f32ac26670827c2ee36fd1b07ccc805 /src
parentccd1b2ee01c193cd157978c1f9f08f87d0f9c94b (diff)
downloadQt-7b18c792d0575901d403e475472b9632280f54e7.zip
Qt-7b18c792d0575901d403e475472b9632280f54e7.tar.gz
Qt-7b18c792d0575901d403e475472b9632280f54e7.tar.bz2
Fix jump and property changes on first move when dragging a Flickable.
Fixes a regression whereby on the first mouse move the contentItem was moved the total distance from the touch point to where the drag distance was exceeded. For large drag thresholds this causes a noticeable jump. Task-number: QTBUG-30032 (cherry picked from qtquick1 3a80424aeae19e838be03aa12a5243911ec3f020) Change-Id: I92c119d27dc2e22203484f9ada5978697d171957 Reviewed-by: Martin Jones <martin.jones@jollamobile.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 3edc62d..f05bc60 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -788,9 +788,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (q->yflick()) {
int dy = int(event->pos().y() - pressPos.y());
- if (vData.dragStartOffset == 0)
- vData.dragStartOffset = dy;
if (qAbs(dy) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) {
+ if (!vMoved)
+ vData.dragStartOffset = dy;
qreal newY = dy + vData.pressPos - vData.dragStartOffset;
const qreal minY = vData.dragMinBound;
const qreal maxY = vData.dragMaxBound;
@@ -817,9 +817,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (q->xflick()) {
int dx = int(event->pos().x() - pressPos.x());
- if (hData.dragStartOffset == 0)
- hData.dragStartOffset = dx;
if (qAbs(dx) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) {
+ if (!hMoved)
+ hData.dragStartOffset = dx;
qreal newX = dx + hData.pressPos - hData.dragStartOffset;
const qreal minX = hData.dragMinBound;
const qreal maxX = hData.dragMaxBound;