summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-10-27 03:07:33 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-10-27 03:07:33 (GMT)
commitb214f0da048a71cd7da410c32c111d3b92cbca47 (patch)
tree7bb6ab0f62e858e24c48508c946502c08e131a7e
parente22a3c2ba8fae9514b5adcc35e8215caf3812871 (diff)
downloadQt-b214f0da048a71cd7da410c32c111d3b92cbca47.zip
Qt-b214f0da048a71cd7da410c32c111d3b92cbca47.tar.gz
Qt-b214f0da048a71cd7da410c32c111d3b92cbca47.tar.bz2
Fix dragging at the end of a flickable with overShoot: false
-rw-r--r--src/declarative/fx/qfxflickable.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp
index a83ee66..cbfe9f6 100644
--- a/src/declarative/fx/qfxflickable.cpp
+++ b/src/declarative/fx/qfxflickable.cpp
@@ -618,11 +618,18 @@ void QFxFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
newY = minY + (newY - minY) / 2;
if (newY < maxY && maxY - minY < 0)
newY = maxY + (newY - maxY) / 2;
- if (q->overShoot() || (newY <= minY && newY >= maxY)) {
+ if (!q->overShoot() && (newY > minY || newY < maxY)) {
+ if (newY > minY)
+ newY = minY;
+ else if (newY < maxY)
+ newY = maxY;
+ else
+ rejectY = true;
+ }
+ if (!rejectY) {
_moveY.setValue(newY);
moved = true;
- } else if (!q->overShoot())
- rejectY = true;
+ }
if (qAbs(dy) > DragThreshold)
stealMouse = true;
}
@@ -638,11 +645,19 @@ void QFxFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
newX = minX + (newX - minX) / 2;
if (newX < maxX && maxX - minX < 0)
newX = maxX + (newX - maxX) / 2;
- if (q->overShoot() || (newX <= minX && newX >= maxX)) {
+ if (!q->overShoot() && (newX > minX || newX < maxX)) {
+ if (newX > minX)
+ newX = minX;
+ else if (newX < maxX)
+ newX = maxX;
+ else
+ rejectX = true;
+ }
+ if (!rejectX) {
_moveX.setValue(newX);
moved = true;
- } else if (!q->overShoot())
- rejectX = true;
+ }
+
if (qAbs(dx) > DragThreshold)
stealMouse = true;
}