diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-04-29 17:11:14 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-04-30 12:37:34 +0000 |
commit | 80bed9cd22f92673d6945941bfac0c312bc7b3ae (patch) | |
tree | 534302bea0042dca17d6db934a5f6c3bfc921533 | |
parent | db9b1590c4d866504ee129e07339751f69128071 (diff) |
Fix 'discrete' animations
If interpolation is not possible the 'animation' did
happen one frame to late.
Change-Id: I320c3e5e2e62c9fe204d39441d6a2e3456a89691
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | src/imports/timeline/qquickkeyframe.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/imports/timeline/qquickkeyframe.cpp b/src/imports/timeline/qquickkeyframe.cpp index a8c72c4..e6aeeeb 100644 --- a/src/imports/timeline/qquickkeyframe.cpp +++ b/src/imports/timeline/qquickkeyframe.cpp @@ -340,8 +340,12 @@ QVariant QQuickKeyframe::evaluate(QQuickKeyframe *pre, qreal frametime, int user QVariant convertedValue = value(); convertedValue.convert(userType); - if (!interpolator) - return preValue; + if (!interpolator) { + if (progress < 1.0) + return preValue; + + return convertedValue; + } if (preValue.isValid() && convertedValue.isValid()) return interpolator(preValue.constData(), convertedValue.constData(), progress); |