diff options
author | Lasse Räihä <lasse.raiha@digia.com> | 2013-05-31 10:51:08 +0300 |
---|---|---|
committer | Kimmo Ollila <kimmo.ollila@digia.com> | 2013-05-31 10:52:20 +0300 |
commit | d3c7e010bb5cf2f18c89f58efa61552fa2985c22 (patch) | |
tree | 912987f78062960bc2bc9fe9afc09f0b7803813f | |
parent | 968ec47f24ccb7932e29fdd518692377410ce146 (diff) |
Fixed a bug when user navigate very fast.
Change-Id: Ib612fb1c8a67ed0f3a66bbc21e6f6dc283cbd9db
Reviewed-by: Kimmo Ollila <kimmo.ollila@digia.com>
-rw-r--r-- | QtDemo/qml/QtDemo/WorldCanvas.qml | 4 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/main.qml | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/QtDemo/qml/QtDemo/WorldCanvas.qml b/QtDemo/qml/QtDemo/WorldCanvas.qml index 563239b..95a8a1e 100644 --- a/QtDemo/qml/QtDemo/WorldCanvas.qml +++ b/QtDemo/qml/QtDemo/WorldCanvas.qml @@ -51,11 +51,11 @@ Item{ function goNext() { goTo(app.getNext(), false); - navigationAnimation.restart() + navigationAnimation.restartAnimation() } function goPrevious() { goTo(app.getPrevious(), false); - navigationAnimation.restart() + navigationAnimation.restartAnimation() } function goBack() diff --git a/QtDemo/qml/QtDemo/main.qml b/QtDemo/qml/QtDemo/main.qml index a143dfa..40371a7 100644 --- a/QtDemo/qml/QtDemo/main.qml +++ b/QtDemo/qml/QtDemo/main.qml @@ -132,6 +132,13 @@ Rectangle{ SequentialAnimation { id: navigationAnimation + property int animCounter: 0 + + function restartAnimation() { + navigationAnimation.animCounter++; + restart(); + } + NumberAnimation { id: zoomOutAnimation target: canvas; @@ -151,10 +158,11 @@ Rectangle{ } onRunningChanged: { - if (!running) { - if (navigationState === 2) - Engine.loadCurrentDemo(); - } + if (!running) + animCounter-- + + if (animCounter === 0 && navigationState === 2) + Engine.loadCurrentDemo(); } } |