I'm trying to figure out the algorithm for scaling multiple selected objects on a canvas (similar to Visio's behavior). Say for instance I have the following selected objects in my application:
I then drag the lower-right handle of the bounding box to increase the size of the selected objects and thus produce the following results:
My questions are as follows:
- How do I get the amount of scaling to be applied to each object?
- How do I get the amount of translation to be applied to each object?
I hope this question makes sense. And I hope you could help.
Hi I dont think there is any Translation , There is only Scaleing . One easy way to do that is preserve the Width and Height of your object like (TextBoxes above) and then when you want to get Scaleing values of that object
This will give you the amount by which object is scaled corressponding to the Width and Height of TextBox at the beginning (i.e When window initialized) . I hyope this will give you an idea.