summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorWang Chuan <ouchuanm@outlook.com>2020-11-30 21:09:42 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-07 19:27:02 +0000
commit01474c31ba2a3ca225cbc2440bd0ee28458b2a26 (patch)
treef84cc8648fec9d62f5169c1958504028eff8c007 /src/widgets/styles
parentfd492d460fad9641832373e95e07a02cd4d7722e (diff)
QStyleAnimation: make sure the last frame of animation is rendered
Amend to 8738f09b9fc1b35e3dc78211368d87069f3071f7. The last frame of animation might be lacked if [_skip < fps]. Fixes: QTBUG-89118 Change-Id: Ia0345e2aff7579afe2d60c4e7495bfaa1f36198c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 04fed9f77e3288f69fe89bcb8a3f1cdbe02ce219) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstyleanimation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp
index ce3b6ce34a..d367bc491a 100644
--- a/src/widgets/styles/qstyleanimation.cpp
+++ b/src/widgets/styles/qstyleanimation.cpp
@@ -122,9 +122,9 @@ bool QStyleAnimation::isUpdateNeeded() const
return currentTime() > _delay;
}
-void QStyleAnimation::updateCurrentTime(int)
+void QStyleAnimation::updateCurrentTime(int time)
{
- if (++_skip >= _fps) {
+ if (++_skip >= _fps || time >= duration()) {
_skip = 0;
if (target() && isUpdateNeeded())
updateTarget();