tweenjs / es6-tween

ES6 version of tween.js
MIT License
186 stars 34 forks source link

Can't stop tween when Infinit repeat. #41

Closed lizistorm closed 6 years ago

lizistorm commented 6 years ago

Can't stop tween when Infinit repeat. It just ignore when _isFinite is false in Tween.stop/Lite.stop.

But in origin tween.js version there is no _isFinite check in stop function.

dalisoft commented 6 years ago

Hi. Thanks for issue. I know this bug, because of createUi i did this trick. But i will introduce major update in 2-3days or max next week. Until it please wait. I am very want fix, but because of my work i have not time

dalisoft commented 6 years ago

Or you can modify code for yourself. If not know TypeScript, after installation with npm, run 'tsc' on directory and you should see src compiled foldrr

lizistorm commented 6 years ago

OK. Thanks!

Just remove _isFinite check in stop().

change if (!_isPlaying || !_isFinite) { return this; } to if (!_isPlaying) { return this; }

And maybe _r in stop() should be _reversed. Or it will not go back to start value when reversed.

change let atEnd = (_r + 1) % 2 === 1; to let atEnd = _reversed % 2 === 1;

dalisoft commented 6 years ago

I already fix that in local machine. Just not find time to upload. Thanks for fix again

dalisoft commented 6 years ago

Your issue should resolve 4.0.1