I'm in need of some help, in case anyone can help me ...
So, here's the situation:
I have group that contain several graphics inside and I want to zoom out ( for example to 50% to have a better view over all graphics inside the group) and zoom in again.
I was able to work this out and the resize of the graphics is working fine. The problem is the location of the graphic that doesn't stay where it should after the zoom.
so, how am I approaching the zoom:
- each graphic has its original size store on a custom property.
- When I zoom, I multiply the W and H of the graphic by the Zoom factor (zoom percentage divided by 100). This works just fine.
- Then, I also multiply the graphic location by the zoom facto to move the graphic to the correct location after the resize. However this is not working as I expected.
When I add a new graphic to the group and the zoom is at 100%, that would be easy. The problem would be "how to update the location, when the graphic is moved and the zoom is not at 100% (or a new graphic is added to the group when the zoom is not at 100%).
So, my question is: Does anyone can see what am I missing? is there another/better way to do this?
I have attached a example stack for you to see.
Any thanks in advance,
- Miguel Pinto