Unexpected behaviour when changing text & speed on a playing animation #2155
Replies: 3 comments 5 replies
-
Sample project used to create the video above: |
Beta Was this translation helpful? Give feedback.
-
To have the main thread rendering engine update its text dynamically, it may be necessary to add a new |
Beta Was this translation helpful? Give feedback.
-
I don't fully understand the jitter you mention in the Core Animation rendering engine. When I run the sample app you shared, the behavior seems reasonable to me. There's a lot going on so I may be missing something. Perhaps a simpler example would help me understand better. |
Beta Was this translation helpful? Give feedback.
-
Which Version of Lottie are you using?
Lottie 4.2.0
Expected Behavior
I would expect static text in an animation to be editable as the animation is playing, regardless of the rendering engine.
Also, I would expect that changing the animation speed while playing an animation happens smoothly when the rendering engine is set to automatic (it is smooth on mainThread).
Actual Behavior
In this example I have made some code that changes the speed of the animation every 0.5 seconds as its playing. It also change the text of the textprovider every 0.5 seconds. When the rendering engine is set to .automatic (top animation), the animation seems to have some jitter every time the speed is changed (it seems to be playing it from a slightly earlier frame). The text updates nicely here. When rendering engine is set to .mainThread (bottom animation), the animation updates smoothly. However, the text is never updated anymore. I have tried calling
forceDisplayUpdate()
but this has no effect on the text.lottie-animaton.mov
Beta Was this translation helpful? Give feedback.
All reactions