summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativepathview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-30 06:14:20 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-30 06:14:20 (GMT)
commit3011031d0d95d47e7597a81ecbf47004664c4ed9 (patch)
treee2d0b12abe32ed8ce8d567d033b15c2c49ff845c /src/declarative/graphicsitems/qdeclarativepathview.cpp
parent4a2c238a6dfbbdf3bd27a91efc96b747944e767a (diff)
parentdeb92c796c727c6ad0eaf28929cda6d000c1b3c1 (diff)
downloadQt-3011031d0d95d47e7597a81ecbf47004664c4ed9.zip
Qt-3011031d0d95d47e7597a81ecbf47004664c4ed9.tar.gz
Qt-3011031d0d95d47e7597a81ecbf47004664c4ed9.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepathview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index b35d30d..7cb723c 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -966,7 +966,12 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
else
dist = qRound(dist - d->offset) + d->offset;
// Calculate accel required to stop on item boundary
- accel = v2 / (2.0f * qAbs(dist));
+ if (dist <= 0.) {
+ dist = 0.;
+ accel = 0.;
+ } else {
+ accel = v2 / (2.0f * qAbs(dist));
+ }
}
d->moveOffset.setValue(d->offset);
d->tl.accel(d->moveOffset, velocity, accel, dist);