0

I'm building a Mac App where I an image can be added to the screen and can be modified via NSAffineTransform, translating and rotating the objects are fine but scaling has an issue if the object has been rotated

When the user selects the object it generates 4 about points at the corners of the object so when scaling from the bottom-right corner it should keep the object at top-left but instead it pulls away slightly from the top-left, it may only be partially but as the scaling gets larger the effect is more present.

There have been other users with similar issues to this in other languages but as none of these are working for me its probably best to open a new question

Similar issue How I want it to be

Community
  • 1
  • 1
Alan MacGregor
  • 501
  • 2
  • 13
  • are you constructing the transform yourself? If so, how? – Hammer Sep 12 '12 at 14:57
  • I'm sorry but you need to be a lot more clear than that. Post some code or explain exactly how you get "the transform", "the original transform", and what you mean by "appending the transform onto this" – Hammer Sep 12 '12 at 21:16
  • I'm currently adding the transform onto the original transform by setting the object with its original transformStruct and then appending the transforms onto the object The scale is worked out in the following: (currentPoint - appositeAnchorPoint) / (originalPoint - appositeAnchorPoint) The translate is currently being worked out in the following: oppositeAnchorPoint * (1 - calculatedScale) This all works fine when the object is at a 90,80,270, 260 degree angle – Alan MacGregor Sep 12 '12 at 21:27

0 Answers0