diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-04-30 06:14:20 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-04-30 06:14:20 (GMT) |
commit | 3011031d0d95d47e7597a81ecbf47004664c4ed9 (patch) | |
tree | e2d0b12abe32ed8ce8d567d033b15c2c49ff845c /src/declarative/graphicsitems/qdeclarativepathview.cpp | |
parent | 4a2c238a6dfbbdf3bd27a91efc96b747944e767a (diff) | |
parent | deb92c796c727c6ad0eaf28929cda6d000c1b3c1 (diff) | |
download | Qt-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.cpp | 7 |
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); |