From 8d130f26d9ef1e3acd76c0c158b41b8d2b3c1b44 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 9 Sep 2010 15:50:02 +1000 Subject: Fix reversingModes of QDeclarativeSmoothedAnimation None of them actually worked. The updated visual test now shows the correct behavior. Task-number: QTBUG-13513 --- src/declarative/util/qdeclarativesmoothedanimation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp index b2f02e6..c3fa7cf 100644 --- a/src/declarative/util/qdeclarativesmoothedanimation.cpp +++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp @@ -214,22 +214,23 @@ void QSmoothedAnimation::init() } bool hasReversed = trackVelocity != 0. && - ((trackVelocity > 0) == ((initialValue - to) > 0)); + ((!invert) == ((initialValue - to) > 0)); if (hasReversed) { switch (reversingMode) { default: case QDeclarativeSmoothedAnimation::Eased: + initialVelocity = -trackVelocity; break; case QDeclarativeSmoothedAnimation::Sync: QDeclarativePropertyPrivate::write(target, to, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); + trackVelocity = 0; stop(); return; case QDeclarativeSmoothedAnimation::Immediate: initialVelocity = 0; - delayedStop(); break; } } -- cgit v0.12