summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxflickable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx/qfxflickable.cpp')
-rw-r--r--src/declarative/fx/qfxflickable.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp
index 3580edb..a82385a 100644
--- a/src/declarative/fx/qfxflickable.cpp
+++ b/src/declarative/fx/qfxflickable.cpp
@@ -597,7 +597,13 @@ void QFxFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
int dx = int(event->pos().x() - pressPos.x());
if (qAbs(dx) > FlickThreshold || pressTime.elapsed() > 200) {
qreal newX = dx + pressX;
- if (q->overShoot() || (newX <= q->minXExtent() && newX >= q->maxXExtent())) {
+ const qreal minX = q->minXExtent();
+ const qreal maxX = q->maxXExtent();
+ if (newX > minX)
+ newX = minX + (newX - minX) / 2;
+ if (newX < maxX && maxX - minX < 0)
+ newX = maxX + (newX - maxX) / 2;
+ if (q->overShoot() || (newX <= minX && newX >= maxX)) {
if (dragMode == QFxFlickable::Hard)
_moveX.setValue(newX);
else