jsco Posted January 8, 2020 Share Posted January 8, 2020 I have a path that has a transform on it like this: <path d="M 5794.010417 13741.015625 L 6057.942708 14725" transform="matrix(0.03,0,0,-0.03,0,842)" /> and I want to animate an element to move along this path. Unfortunately because of the transform there is an offset. Is there a way for me to remove the transform without moving the svg or a way to apply to the element that I'm moving aswell? See the Pen rNapKXz by jescowuester (@jescowuester) on CodePen Link to comment Share on other sites More sharing options...
elegantseagulls Posted January 8, 2020 Share Posted January 8, 2020 Hi @jsco, I ran your svg through SVGOMG (https://jakearchibald.github.io/svgomg/), and that stripped the transform from the path, while keeping it in the same positioning. Updated SVG is here: See the Pen yLyKByw by ryan_labar (@ryan_labar) on CodePen 5 Link to comment Share on other sites More sharing options...
GreenSock Posted January 10, 2020 Share Posted January 10, 2020 Another option is to use align, offsetX, and offsetY like this: See the Pen 516d888647ffedae2ea2e7eaf2ab7faa?editors=0010 by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
GreenSock Posted January 15, 2020 Share Posted January 15, 2020 Actually, the next release has a tweak that automatically handles this for you, so you can simply align: "#path". I've already updated the live codepen version of MotionPathPlugin which you can see in the last demo I posted. 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now