Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@trusktr

Description

@trusktr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions