-
-
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
SVG's preserve aspect ratio attribute not used in path animation #726
Comments
This sounds like it may be related to #556..? can you check and see if the solution proposed by #568 and #659 fixes this issue, too?
(from #556 (comment)) |
I'm not going to change the way path coordinates are scaled when animating a dom element external to the SVG because this will need to cover a huge amount of edge cases. In the upcoming v3.2.1, if the path styles required to be in a more complex SVG viewport (like in your example) you'll be able to animated an element inside the SVG without any problem. You can see the difference between animating an element outside or inside the SVG with different viewport values here : https://github.com/juliangarnier/anime/blob/v3.2.1/documentation/examples/anime-svg-path-animation-responsive.html Hope that helps! |
@juliangarnier It did help! Thank you! I completely understand not wanting to change scaling for external elements if internal ones are already scaled correctly, but I had no idea that was the case. Your example worked perfectly to demonstrate the difference, it's a shame it's not featured more prominently on the documentation page. Overall, an excellent framework you have here! I'm glad I could use it in this case. |
When you use the SVG attribute
preserveaspectratio
, the path's locations are incorrect for animation.Minimal reproduction: https://codepen.io/robbertkooiman/pen/WNxvNBB
I would expect the animation to find and adhere to cropping of the SVG, so that it still does follow the actual path it's been assigned.
The text was updated successfully, but these errors were encountered: