aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@jollamobile.com>2013-11-20 22:36:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 23:35:44 +0100
commit21a03c02848bb35fe665223f49ba9643cce343b7 (patch)
treed1d3733daae95361c27ff1d83895abdcc8fb0390 /src/quick
parent43f1cc98bf1899ae29e3fb0b3bf5054d5a23d4b2 (diff)
QSmoothedAnimation: Don't set property if animation isn't running
This could cause things to get "stuck" in the wrong state under some rather hard to reproduce conditions. Change-Id: Ied23d2bdfcfd0b197f4b28fed9c82ffd64e52ebf Done-with: Aaron Kennedy <aaron.kennedy@jollamobile.com> Done-with: Alan Alpert <416365416c@gmail.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/util/qquicksmoothedanimation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp
index 017fe39003..9e9e6cb419 100644
--- a/src/quick/util/qquicksmoothedanimation.cpp
+++ b/src/quick/util/qquicksmoothedanimation.cpp
@@ -242,6 +242,9 @@ qreal QSmoothedAnimation::easeFollow(qreal time_seconds)
void QSmoothedAnimation::updateCurrentTime(int t)
{
+ if (!isRunning() && !isPaused()) // This can happen if init() stops the animation in some cases
+ return;
+
qreal time_seconds = useDelta ? qreal(QQmlAnimationTimer::instance()->currentDelta()) / 1000. : qreal(t - lastTime) / 1000.;
if (useDelta)
useDelta = false;