vue-free-transform icon indicating copy to clipboard operation
vue-free-transform copied to clipboard

Why does scaling effect the "x", "y"

Open demobiel opened this issue 6 years ago • 2 comments

Hi

first of all, this plugin seems very nice, but I don't understand what happens when you scale the object with the scale handlers.

It seems that inside the payload object returned by the update event the x and y attribute changes as well even if you use the right bottom handler.

It seems to me this should only be the case if the top corner changes it's position (as I understand that that is what "x" and "y" is.

I forked your example and added some logging: https://codesandbox.io/s/l49ryyjjom

Am I misunderstanding what is going on?

demobiel avatar Oct 07 '18 08:10 demobiel

Same issue here. It looks like the "x" value is recalculated when scaled (with or without the "scale-from-center" property set). Let's say that I have a shape with an initial x position of 10, a width of 25 and a scaleX of 1. If I scale the shape so that scaleX becomes 2, then the x data becomes (10+25)=35. I don't dare to change the code though, there could some side effects if I try to change the logic!

bperel avatar Jun 15 '19 09:06 bperel

Got same issue here. Hopefully fixed someday

devonik avatar Jan 20 '20 18:01 devonik