Re: origin: lower left vs lower right
Re: origin: lower left vs lower right
- Subject: Re: origin: lower left vs lower right
- From: Uli Kusterer <email@hidden>
- Date: Thu, 3 Feb 2011 12:51:15 +0100
On 03.02.2011, at 04:19, Todd Heberlein wrote:
> During the recent text orientation/position thread a couple of things caught my attention: (1) the text system seemed designed to have a flipped view (origin in the upper left), and (2) the iOS version of an NSView, the UIView, also has an origin in the upper left.
>
> If starting some new graphical code for Cocoa (which I may want to port parts of to iOS), is it advisable to use a flipped coordinate system (origin in upper left)? In other words, is "upper left" the origin of the future?
It's not a matter of "the future" it is a matter of purpose. Mathematics has traditionally had the origin in the lower left, so if you're working with equations from textbooks, it is more convenient to leave the coordinate system unflipped.
However, historically human writing and the Mac user interface have had a top-left to lower-right direction, so if you are laying out lists, or text, or other sequences for humans, it is generally more convenient (and even efficient) to use a flipped coordinate system. Otherwise, if you for example resize a window, you have to manually adjust any content that is aligned with the upper left, because when resizing an unflipped coordinate system, the upper left corner has "moved", even though on a Mac the grow box is in the lower right.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden