diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-10-27 03:07:33 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-10-27 03:07:33 (GMT) |
commit | b214f0da048a71cd7da410c32c111d3b92cbca47 (patch) | |
tree | 7bb6ab0f62e858e24c48508c946502c08e131a7e | |
parent | e22a3c2ba8fae9514b5adcc35e8215caf3812871 (diff) | |
download | Qt-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.cpp | 27 |
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; } |