• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Rotating an NSView around its center
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rotating an NSView around its center


  • Subject: Rotating an NSView around its center
  • From: Michael Becker <email@hidden>
  • Date: Fri, 11 Mar 2005 15:50:44 +0100

Hello!

I am trying to rotate a custom NSView around its center point. Imagine something like the Sketch Example program. I have a small custom view on my "canvas" and want to rotate it around its origin. Doing that with NSBezierPaths is easy, just translating to the coordinate origin, rotating, and translating back.

But I cannot seem to do this with an NSView. -setFrameRotation: is rotating around the frame's origin (so changing the frame's origin won't make any difference). Is there any way I can achieve the wanted behavior? I could live with calculations to relocate the frame's origin after rotating, but I guess that will have some pretty ugly trigonometric math involved :-)

Regards,
Michael

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Rotating an NSView around its center
      • From: "Mike R. Manzano" <email@hidden>
  • Prev by Date: Re: simple AppKit / multithreading question
  • Next by Date: Re: Cocoa from C++ (dont want to mix it)
  • Previous by thread: Re: NSPopUpButtonCell in custom NSTableColumn in NSTableView - not changing value
  • Next by thread: Re: Rotating an NSView around its center
  • Index(es):
    • Date
    • Thread