diff options
Diffstat (limited to 'src/quick/util/qquickanimatorjob.cpp')
-rw-r--r-- | src/quick/util/qquickanimatorjob.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp index 2ae8a5a2aa..f027e9fafe 100644 --- a/src/quick/util/qquickanimatorjob.cpp +++ b/src/quick/util/qquickanimatorjob.cpp @@ -285,6 +285,17 @@ qreal QQuickAnimatorJob::progress(int time) const return m_easing.valueForProgress((m_duration == 0) ? qreal(1) : qreal(time) / qreal(m_duration)); } +void QQuickAnimatorJob::boundValue() +{ + qreal rangeMin = m_from; + qreal rangeMax = m_to; + if (m_from > m_to) { + rangeMax = m_from; + rangeMin = m_to; + } + m_value = qBound(rangeMin, m_value, rangeMax); +} + qreal QQuickAnimatorJob::value() const { qreal value = m_to; |