summaryrefslogtreecommitdiff
path: root/src/corelib/animation
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qabstractanimation.h1
-rw-r--r--src/corelib/animation/qvariantanimation.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index 7f2577d7f7..212fbea161 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
class QAnimationGroup;
class QSequentialAnimationGroup;
class QAnimationDriver;
+class QUnifiedTimer;
class QAbstractAnimationPrivate;
class Q_CORE_EXPORT QAbstractAnimation : public QObject
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index 98b02f0202..eac1524107 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -276,7 +276,9 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress)
const qreal startProgress = currentInterval.start.first;
const qreal endProgress = currentInterval.end.first;
- const qreal localProgress = (progress - startProgress) / (endProgress - startProgress);
+ const qreal localProgress =
+ qIsNull(progress - startProgress) ? 0.0 // avoid 0/0 below
+ /* else */ : (progress - startProgress) / (endProgress - startProgress);
QVariant ret = q->interpolated(currentInterval.start.second,
currentInterval.end.second,