summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-03 05:43:48 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-03 05:43:48 (GMT)
commita0b531163a79c9097185b580fdf4aa8157cead41 (patch)
tree405d2e8a321aff874cfd3ad65279b9f747f9f16b
parent68c0ff0c7f1e65fb55b08a1fb9baab8176eb726c (diff)
downloadQt-a0b531163a79c9097185b580fdf4aa8157cead41.zip
Qt-a0b531163a79c9097185b580fdf4aa8157cead41.tar.gz
Qt-a0b531163a79c9097185b580fdf4aa8157cead41.tar.bz2
Fix Flickable.StopAtBounds behavior when content size < flickable size
Clip the content position to the beginning rather than the end, if both apply. Task-number: QTBUG-12573 Reviewed-by: Michael Brasser
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 998b33a..19cabdd 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -681,12 +681,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (newY < maxY && maxY - minY <= 0)
newY = maxY + (newY - maxY) / 2;
if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newY > minY || newY < maxY)) {
- if (newY > minY)
- newY = minY;
- else if (newY < maxY)
+ rejectY = true;
+ if (newY < maxY) {
newY = maxY;
- else
- rejectY = true;
+ rejectY = false;
+ }
+ if (newY > minY) {
+ newY = minY;
+ rejectY = false;
+ }
}
if (!rejectY && stealMouse) {
vData.move.setValue(qRound(newY));
@@ -708,12 +711,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (newX < maxX && maxX - minX <= 0)
newX = maxX + (newX - maxX) / 2;
if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newX > minX || newX < maxX)) {
- if (newX > minX)
- newX = minX;
- else if (newX < maxX)
+ rejectX = true;
+ if (newX < maxX) {
newX = maxX;
- else
- rejectX = true;
+ rejectX = false;
+ }
+ if (newX > minX) {
+ newX = minX;
+ rejectX = false;
+ }
}
if (!rejectX && stealMouse) {
hData.move.setValue(qRound(newX));