Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] calling tween.stop() does not cause tween.update() to return false #665

Open
trusktr opened this issue Aug 7, 2023 · 0 comments
Open
Labels

Comments

@trusktr
Copy link
Member

trusktr commented Aug 7, 2023

Calling tween.stop() should stop the tween, and a following tween.update(time) (f.e. in an animation frame) should return false so that the return value is reliable for exiting the animation loop. Currently this will fail:

function loop(time) {
  const keepGoing = tween.update(time)
  if (keepGoing) requestAnimationFrame(loop)
}

loop(performance.now())

// ... later, before the animation is finished ...
tween.stop() // Does not cause the loop to stop, the loop keeps going.

The tween.stop() call should cause tween.update() to return true so that the animation loop will end.

@trusktr trusktr added the Bug label Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant