Skip to content
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

Can't apply animated some properties (stroke, rect width, circle diameter) with Greensock #27

Closed
chrisgannon opened this issue May 30, 2019 · 2 comments

Comments

@chrisgannon
Copy link

chrisgannon commented May 30, 2019

The values are definitely animating in GSAP but some are not updating the shape's property.

Diameter does not work
https://codepen.io/chrisgannon/pen/db98d513d1939929876ef03cccf3f8b1

Stroke does work
https://codepen.io/chrisgannon/pen/c5d9f322bb6c42d4c6d89f45a34e560e

@desandro
Copy link
Member

Hi Chris. Thanks for reporting this one.

Changes to an item's shape or path require that updatePath() be triggered. This includes properties like width, diameter, or vectors within path.

Most other properties like translate, rotate, scale, stroke, color are all directly changeable.

I realize this is a weird gotcha. The reason is that Zdog has to re-calculate vectors and stuff when the shape changes, but all the other values are directly used. I don't think I called this out in the docs right, so if you've got an idea on that I'm all ears.

@chrisgannon
Copy link
Author

Excellent! I have updated the pen to show the solution. Having read through the docs again I now see the updatePath() function.

Maybe you could add a 'Gotcha' section where possible confusions like this are described. I appreciate they are in the docs already so maybe it's not necessary. I (wrongly) assumed updateRenderGraph() would update everything - maybe others will too.

Anyway thanks for the solution. I'm glad it's working - I'm having so much fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants