diff options
author | Thomas Kristensen <thkriste@cisco.com> | 2013-03-11 12:24:40 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-13 07:06:29 +0100 |
commit | 8c683045f8933a8574a39e8222d29cb5bc5b243a (patch) | |
tree | 36060e29bb7b2d4ef25f10951539293f0a224bfd /src | |
parent | f23ec41d573563e8f2361221bc7bbb5d4d635677 (diff) |
Makes QSmoothedAnimation respect zero duration.
In automated GUI test scenarios it often desired not to wait for animations
before verifying a result, so setting the duration to zero should accomplish
this, before this patch; if duration was set to zero QSmoothedAnimation
would treat it as if duration was not set, and used velocity to calculate
animation speed.
Change-Id: Ie6520d6c595bd014f3cab69bbb527e773f3850da
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/util/qdeclarativesmoothedanimation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp index 1e68a7a1..240bc5d6 100644 --- a/src/declarative/util/qdeclarativesmoothedanimation.cpp +++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp @@ -100,10 +100,10 @@ bool QSmoothedAnimation::recalc() s = (invert? qreal(-1.0): qreal(1.0)) * s; - if (userDuration > 0 && velocity > 0) { + if (userDuration >= 0 && velocity > 0) { tf = s / velocity; if (tf > (userDuration / qreal(1000.))) tf = (userDuration / qreal(1000.)); - } else if (userDuration > 0) { + } else if (userDuration >= 0) { tf = userDuration / qreal(1000.); } else if (velocity > 0) { tf = s / velocity; |