• 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
NSView rotation confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSView rotation confusion


  • Subject: NSView rotation confusion
  • From: Chris Anderson <email@hidden>
  • Date: Thu, 8 Jan 2004 17:52:25 -0800

I've got a document in an NSView; it's filled with graphics, images, and strings I've drawn, and I want to flip the view vertically, so the user can see and interact with it upside down. The coordinate system of the view is itself already flipped (isFlipped returns YES), and the view is inside of an NSScrollView with rulers.

Despite a lot of experimentation, I am unable to get a combination of transforms that does the right thing, so I'm looking for some advice here.

It seems I have three fundamental choices:

1. Rotate the view frame. (This seems like a bad idea for a variety of reasons.)
2. Rotate "by hand" with transforms in drawRect: (which seems like extra work because I'll also have to inverse transform all the mouse coordinates for events, and do something else about the rulers) or
3. Rotate the view bounds by 180 degrees (which is what I've been trying to do.)

First, is this the "right" choice?

And if it is, what the heck combination of transforms/state changes to the view will make it happen correctly, and, for example, should isFlipped still return YES after the rotation is applied? I've gotten all sorts of bizarre results with my experiments so far, but nothing quite correct. I seek enlightenment... this ought to be simple (?!?)

Regards,

---Chris A
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Help - Programmatically creating bindings in Java
  • Next by Date: Re: Thinking about shareware prices...
  • Previous by thread: Re: CoreFoundation and CFDate functions - question on memory de-allocation
  • Next by thread: quicktime waveform
  • Index(es):
    • Date
    • Thread