Roger
Roger

Reputation: 4797

Rotating an NSView

I need to rotate the frame of an instance of NSView in such a way that its width becomes its height and its height becomes its width. The view contains a string and it is important that this string is rotated as well.

I had a look at NSView's setFrameRotation: but this rotates around the frame origin which is not what I want. I suppose that technically my requirement is not a rotation but more a mirroring at a 45 degree angle from the origin.

How can I accomplish this?

Upvotes: 2

Views: 3860

Answers (1)

dadoftutu
dadoftutu

Reputation: 49

Try Desire to rotate around centre

This piece of could should helper.

[NSView rotateByAngle]

Upvotes: 2

Related Questions