diff options
author | Andreas Buhr <andreas@andreasbuhr.de> | 2021-01-14 17:58:35 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2022-05-07 16:41:18 +0200 |
commit | cc49e68bdf5be947cd9a6aac07bc9915fe0c5af4 (patch) | |
tree | ca903f076e6ba30142a64b602ba6a874024f175b /src/qml/qml/qqmlpropertycachecreator_p.h | |
parent | 38fd73dd3a2ff8903680a8aab0f45719cdd362d5 (diff) |
Do not re-source the from value in animation with multiple loops
Animations with multiple loops without an explicitly set 'from'
value were trying to use the last value from the previous loop
as the new starting value for the next loop.
This is not correct for several reasons:
- when we have multiple loops, it's not guaranteed that the last value
of the previous loop is actually the 'to' value. In practice it is
a bit smaller.
- even if it was the expected 'to' value, the next loop would have been
executed in the range [to; to] - so nothing would have happened.
The code in bugreport for the related issue tries to implement a
binding:
NumberAnimaton {
// note that the 'from' property is not defined here
to: from + 360
loops: Animation.Infinite
}
But I believe such binding does not work in practice, because the 'from'
*property* is not actually updated at each loop.
So the most reasonable approach for the animations with multiple loops
is to use their initial 'from' value, and do not update it while
looping.
Fixes: QTBUG-84375
Pick-to: 6.3 6.2
Change-Id: I550873887bf8a328fe4eda9b0e8e058f921124b1
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertycachecreator_p.h')
0 files changed, 0 insertions, 0 deletions