From 00b07f98747e36778493cceac36c151722119a15 Mon Sep 17 00:00:00 2001 From: bodymovin Date: Fri, 15 Nov 2024 02:25:17 +0000 Subject: [PATCH] return keep going when a state machine has changed its state previously, when an animation advanced by 0 seconds, it would return true, which was interpreted as meaning that the animation needed to keep advancing. We changed that behavior and now a linear animation will return false if it didn't advance. A side effect of that is that now the animation state that calls advance, sets keepGoing to false instead of true. So the animation wouldn't keep going in that frame. Which is ok as long as we add a new condition to identify whether the state machine layer should keep going in the next frame based on whether it changed its state internally. This PR adds that condition Diffs= 51c3bbcde2 return keep going when a state machine has changed its state (#8564) Co-authored-by: hernan --- .rive_head | 2 +- .../java/app/rive/runtime/kotlin/core/RiveListenerTest.kt | 4 ++++ submodules/rive-runtime | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.rive_head b/.rive_head index 013e4c87..1ad05cd2 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -50e31c53f0cf563f0291cafb4091a7657e94f3a9 +51c3bbcde2dbd0c07d63ca2d1569f53aba668c23 diff --git a/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveListenerTest.kt b/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveListenerTest.kt index 2a5da150..63f9db79 100644 --- a/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveListenerTest.kt +++ b/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveListenerTest.kt @@ -311,6 +311,10 @@ class RiveListenerTest { // as before lets advance beyond the end of the animation, in this case change to exit! renderer.advance(1.0f) + // will return true because there was a change of state with this last advance + assertEquals(true, view.isPlaying) + renderer.advance(0.1f) + assertEquals(false, view.isPlaying) assertEquals(1, observer.states.size) assertEquals(true, observer.states[0].stateName == "ExitState") diff --git a/submodules/rive-runtime b/submodules/rive-runtime index 1d74fc92..6ee812bc 160000 --- a/submodules/rive-runtime +++ b/submodules/rive-runtime @@ -1 +1 @@ -Subproject commit 1d74fc9266c4844d3b9917f76d6e1e4c1e4c9e7a +Subproject commit 6ee812bcf2179bf29e7214d62f68351742d130f6