-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple .start()
and .to(prop:[])
#602
Multiple .start()
and .to(prop:[])
#602
Conversation
@MasatoMakino Thanks for this! Would you mind making an example for this? |
The more I see changes and fixes like these, the more I start to want to start working on a Timeline/Keyframe/Tween abstraction. It seems Tween is trying to do too much, all in one. |
@trusktr Thanks for your reply. I have made examples of multiple start with CodePen. I also considered adding a new page in |
Closes #378 |
Looks like this got fixed already! https://codepen.io/trusktr/pen/XWGpKyX/10faa7d954bf016a3f0261ca626db17e?editors=1010 There's a similar issue with |
Related Issues
Purpose of this Pull Request
This PR fixes the Issue of tween acceleration on multiple .start().
If an object with an array is passed to
.to()
,_valuesEnd
will be irreversibly changed when.start()
is executed multiple times.As a result, each time you run
.start()
, animation will be faster.Details of the changes
_hasSetupProperty
flag to check if_setupProperties()
has been executed..to()
, startValue will be changed to the current value of the tween target object. Check_valuesStart
and keep it if it is already initialized.tween.js/src/Tween.ts
Lines 169 to 172 in ae24c58
I used this code as a reference for change point 3.
Related pull requests
I think it might be difficult to merge this PR as-is, because of conflicts with features such as
dynamic to
and_propertiesAreSetUp
. In that case, I hope the added test cases will contribute to everyone.