aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations/qabstractanimationjob.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@jollamobile.com>2014-02-12 23:31:22 -0600
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-20 04:27:15 +0100
commit7da483bfbefcaabb1dbbf3e2f1d5b5f7aadc3b06 (patch)
tree30a6bdb4cf3d7275c3acf8ffcfaa5aae0b594819 /src/qml/animations/qabstractanimationjob.cpp
parent587444f033cf51251f36321321ae358d187f37f9 (diff)
Make SmoothedAnimation and SpringAnimation smoothly transition again.
Fix regression introduced in Qt 5.0 when animation backend was rewritten. Task-number: QTBUG-36709 Change-Id: Ib8caa4bc6a38e3bb4c1d1d3961f775fdd2b342c7 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Diffstat (limited to 'src/qml/animations/qabstractanimationjob.cpp')
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index d9e3aff5a4..7fd72d97d2 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -59,7 +59,7 @@ QAnimationJobChangeListener::~QAnimationJobChangeListener()
}
QQmlAnimationTimer::QQmlAnimationTimer() :
- QAbstractAnimationTimer(), lastTick(0), lastDelta(0),
+ QAbstractAnimationTimer(), lastTick(0),
currentAnimationIdx(0), insideTick(false),
startAnimationPending(false), stopTimerPending(false),
runningLeafAnimations(0)
@@ -103,7 +103,6 @@ void QQmlAnimationTimer::updateAnimationsTime(qint64 delta)
return;
lastTick += delta;
- lastDelta = delta;
//we make sure we only call update time if the time has actually changed
//it might happen in some cases that the time doesn't change because events are delayed
@@ -142,8 +141,7 @@ void QQmlAnimationTimer::startAnimations()
{
startAnimationPending = false;
//force timer to update, which prevents large deltas for our newly added animations
- if (!animations.isEmpty())
- QUnifiedTimer::instance()->maybeUpdateAnimationsToCurrentTime();
+ QUnifiedTimer::instance()->maybeUpdateAnimationsToCurrentTime();
//we transfer the waiting animations into the "really running" state
animations += animationsToStart;
@@ -155,12 +153,11 @@ void QQmlAnimationTimer::startAnimations()
void QQmlAnimationTimer::stopTimer()
{
stopTimerPending = false;
- if (animations.isEmpty()) {
+ if (animations.isEmpty() && !startAnimationPending) {
QUnifiedTimer::resumeAnimationTimer(this);
QUnifiedTimer::stopAnimationTimer(this);
// invalidate the start reference time
lastTick = 0;
- lastDelta = 0;
}
}