jeremyckahn / shifty

The fastest TypeScript animation engine on the web
https://jeremyckahn.github.io/shifty/doc/
MIT License
1.54k stars 88 forks source link

Don't stop a tween if it is not playing #78

Closed SBoudrias closed 9 years ago

SBoudrias commented 9 years ago

As this method always schedule another pass on the next animation frame, it happens that some time pass (in laggy browser or at load time) and the time difference would led shifty to believe the animation is over when we actually paused the tween before it ends.

I had some issue tracking this bug down as it was flakey depending on how much the browser would block the main process.

Basically, this bug would appear when using seek at load time or on a low end device (laggy browser). The check for timeoutHandler_isEnded would just bump the animation to its end state.


I'm not sure how we would unit test this bug as it's a pretty edge case behavior...

SBoudrias commented 9 years ago

Ah, wait, I'll rebase correctly

SBoudrias commented 9 years ago

That should do it :smile: