I don't understand why the following example is not working... It only works if I am resizing it once but if I try to resize it again it get's all messed up...
http://jsfiddle.net/JAVWN/1/
You would think that if you called scale() once and then called scale() again, the results would be cumulative, but this doesn't seem to be the case. It seems that if you call scale(), it remembers the original dimensions and scales those rather than the previously recalculated dimensions.
The way I got your example to work was to store the scale (one variable for each dimension) on your object (starting with scaleX = scaleY = 1). Then I multiplied the stored scale by the scale calculated from the final position of the resizer/cursor and stored those in your object. Finally, I used the stored scales in the scale() function call to resize your shapes.
See http://jsfiddle.net/donniec/JAVWN/2/
I fixed it... just use node.resetScale();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With