-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix scaling of path animations #568
Conversation
drop scaling on paths
Can you provide an example where this fails? |
@juliangarnier here's an example: https://codepen.io/cameralibre/pen/BajBVdM |
@cameralibre I can't see what's wrong with this example, can you elaborate a bit more ? |
This change breaks |
This change breaks the path animation of /documentation/examples/anime-svg-lines-animations.html
Sorry I missed the explanation under the demo, very well detailed thank you ! |
I just committed a change on the v3.2.1 branch that fix this issue without breaking the animation when animating element outside the SVG element. You can try it here https://github.com/juliangarnier/anime/blob/v3.2.1/documentation/examples/anime-svg-path-animation-responsive.html |
Sorry if this is a stupid question, but what do I need to do to see that linked page? Here's what I tried (I'm not super experienced with bower/node etc, and I couldn't find any documentation about the website):
|
3.2.1 is out, you can check the live example here : https://animejs.com/documentation/examples/svg-path-animation-responsive.html (The yellow square is part of the SVG element, and is properly scaled, the green one is a div outside the SVG) |
Scaling for paths was not working for me. If the SVG image was larger than the viewbox, the x / y values would be too large. If the SVG image was smaller than the viewbox, the x / y values would be too small.
Removing the multiplication of the scaling factor has solved this issue.