tween.js icon indicating copy to clipboard operation
tween.js copied to clipboard

Handling of repeats with browser tab sleep

Open MasatoMakino opened this issue 5 years ago • 1 comments

Related Issues

#557 When the browser tab sleeps, the delay of repeated tweens is not keep

Purpose of this Pull Request

This fixes handling of repeats.

Details of the changes

When interval for TWEEN.update() is more than one repeat

  • Continuous elapsed
  • Multiple tween._repeat subtractions

MasatoMakino avatar Oct 03 '20 04:10 MasatoMakino

Thanks for doing this! Will review it soon.

trusktr avatar Oct 19 '20 08:10 trusktr

Merged! All existing tests pass, plus the new tests pass, so this is an improvement even if we know it is not working with all features.

What we should do now is start to prevent more complexity, and next we should focus on simplifying, and then Timeline.

trusktr avatar Jan 15 '24 04:01 trusktr

Ah shoot, I'm doing some manual testing, and the 13_relative_start_time example broke. Will revert. But I think 13_relative_start_time will provides some clues as to what is missing

trusktr avatar Jan 15 '24 04:01 trusktr

Hmmm, actually, the 13_relative_start_time example uses .delay(-500). It is not intuitive what "delay negative 500" means, and the improvement of this PR is a lot more significant.

I'm going to change that example so it only uses positive values, "remove" the undocumented "feature", and keep the change from this PR because it is more valuable. The next release will be a major version bump.

trusktr avatar Jan 15 '24 04:01 trusktr

Released in v23.0.0

trusktr avatar Jan 15 '24 07:01 trusktr