From 18f7c187697db224ca412e969663c5e4470cf104 Mon Sep 17 00:00:00 2001 From: Thomas Kristensen Date: Mon, 11 Mar 2013 12:54:56 +0100 Subject: 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: Ia57f1c9ffdd2056ac7c85d1cb94dbd3835fcbb7a Reviewed-by: Andreas Aardal Hanssen --- src/quick/util/qquicksmoothedanimation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index 021ff75f03..9dd9aa2e6d 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -153,10 +153,10 @@ bool QSmoothedAnimation::recalc() s = (invert? -1.0: 1.0) * s; - if (userDuration > 0 && velocity > 0) { + if (userDuration >= 0 && velocity > 0) { tf = s / velocity; if (tf > (userDuration / 1000.)) tf = (userDuration / 1000.); - } else if (userDuration > 0) { + } else if (userDuration >= 0) { tf = userDuration / 1000.; } else if (velocity > 0) { tf = s / velocity; -- cgit v1.2.3