aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickflickable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r--src/quick/items/qquickflickable.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index c1e8dd378c..dd7357822a 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1031,23 +1031,20 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
newY = minY + (newY - minY) / 2;
if (newY < maxY && maxY - minY <= 0)
newY = maxY + (newY - maxY) / 2;
- if (boundsBehavior == QQuickFlickable::StopAtBounds && (newY > minY || newY < maxY)) {
- rejectY = true;
- if (newY < maxY) {
- newY = maxY;
- rejectY = false;
- }
- if (newY > minY) {
- newY = minY;
- rejectY = false;
- }
+ if (boundsBehavior == QQuickFlickable::StopAtBounds && newY <= maxY) {
+ newY = maxY;
+ rejectY = vData.pressPos == maxY && dy < 0;
+ }
+ if (boundsBehavior == QQuickFlickable::StopAtBounds && newY >= minY) {
+ newY = minY;
+ rejectY = vData.pressPos == minY && dy > 0;
}
if (!rejectY && stealMouse && dy != 0.0) {
clearTimeline();
vData.move.setValue(newY);
vMoved = true;
}
- if (overThreshold)
+ if (!rejectY && overThreshold)
stealY = true;
}
}
@@ -1065,24 +1062,22 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
newX = minX + (newX - minX) / 2;
if (newX < maxX && maxX - minX <= 0)
newX = maxX + (newX - maxX) / 2;
- if (boundsBehavior == QQuickFlickable::StopAtBounds && (newX > minX || newX < maxX)) {
- rejectX = true;
- if (newX < maxX) {
- newX = maxX;
- rejectX = false;
- }
- if (newX > minX) {
- newX = minX;
- rejectX = false;
- }
+ if (boundsBehavior == QQuickFlickable::StopAtBounds && newX <= maxX) {
+ newX = maxX;
+ rejectX = hData.pressPos == maxX && dx < 0;
+ }
+ if (boundsBehavior == QQuickFlickable::StopAtBounds && newX >= minX) {
+ newX = minX;
+ rejectX = hData.pressPos == minX && dx > 0;
}
+
if (!rejectX && stealMouse && dx != 0.0) {
clearTimeline();
hData.move.setValue(newX);
hMoved = true;
}
- if (overThreshold)
+ if (!rejectX && overThreshold)
stealX = true;
}
}