diff options
author | Wang Chuan <ouchuanm@outlook.com> | 2020-11-30 21:09:42 +0800 |
---|---|---|
committer | Wang Chuan <ouchuanm@outlook.com> | 2020-12-07 14:43:47 +0000 |
commit | 04fed9f77e3288f69fe89bcb8a3f1cdbe02ce219 (patch) | |
tree | 179444325fcdbde9b0953cd21b8b87b49806bed2 /src/widgets | |
parent | 1c635e805fb449be4687a92c5051d7be118dd9e2 (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
Pick-to: 6.0 5.15
Change-Id: Ia0345e2aff7579afe2d60c4e7495bfaa1f36198c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qstyleanimation.cpp | 4 |
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(); |