Make sure we apply the last transformation step.
authorGunnar Sletta <gunnar.sletta@digia.com>
Thu, 3 Oct 2013 06:52:39 +0000 (08:52 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 3 Oct 2013 15:48:34 +0000 (17:48 +0200)
Change-Id: Ie9b9a04cf41033bb475875f419b16ce91f6a477d
Reviewed-by: Michael Brasser <michael.brasser@live.com>
src/quick/util/qquickanimatorcontroller.cpp

index 1508797..82c66b4 100644 (file)
@@ -74,13 +74,12 @@ void QQuickAnimatorController::advance()
             running = true;
     }
 
-    for (QSet<QQuickAnimatorJob *>::const_iterator it = activeLeafAnimations.constBegin();
-         it != activeLeafAnimations.constEnd(); ++it) {
-        QQuickAnimatorJob *job = *it;
-        if (job->isTransform() && job->target()) {
-            QQuickTransformAnimatorJob *xform = static_cast<QQuickTransformAnimatorJob *>(*it);
-            xform->transformHelper()->apply();
-        }
+    // It was tempting to only run over the active animations, but we need to push
+    // the values for the transforms that finished in the last frame and those will
+    // have been removed already...
+    for (QHash<QQuickItem *, QQuickTransformAnimatorJob::Helper *>::const_iterator it = transforms.constBegin();
+         it != transforms.constEnd(); ++it) {
+        (*it)->apply();
     }
 
     if (running)