Share Posted August 23, 2016 Hi, I'm having trouble figuring out how to properly resize and rotate and svg element. Any suggestions to make this work? Rotating works well, but the scaling resets the rotation and the math is way off. A bonus would be if the handles could move with the resized element but not rotate or resize themselves. Just the red B should be transformed. Thanks! See the Pen EyzoBX by rustydev (@rustydev) on CodePen Link to comment Share on other sites More sharing options...
Share Posted August 23, 2016 Hello, and Welcome to the GreenSock forum! Sorry you having problems rustydev. We appreciate the codepen demo example! It looks like some of the logic inside the scale onDrag callback might be breaking the transform scale. You could also use scale: ratio instead of the transform string .. transform: "scale("+ratio+")" .. when i console out the ratio i see the browser console outputting Infinity for scale. So You will probably also need to add an if statement to make sure scale ratio does not go past a specific scale factor to prevent that ratio from going to Infinity which is breaking it. Please allow us some time to look at and test your example to see what might be going on? Thank You! 1 Link to comment Share on other sites More sharing options...
Share Posted August 23, 2016 What you are trying to do isn't trivial, but I think this demo from swampthang is pretty close to what you are trying to do: http://codepen.io/swampthang/pen/PzdgPW?editors=0010 1 Link to comment Share on other sites More sharing options...
Author Share Posted August 23, 2016 Amazing! Thanks for that link. That looks exactly like what I'm trying to achieve. 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