NSView rotation confusion
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.