tweenjs / tweenjs/tween.js

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

Open
#665 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
TypeScript
Stars
10.1k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the tween.stop() and tween.update(time) entry points described in the issue and trace how stopped tweens affect the update return value. Resolve the contradictory wording about returning false versus true, then verify that calling stop before completion produces the intended value for ending the animation loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.