• 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
Re: coordinate system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coordinate system


  • Subject: Re: coordinate system
  • From: Steve Bird <email@hidden>
  • Date: Thu, 25 Oct 2001 01:23:59 -0400

On Wednesday, October 24, 2001, at 11:53 , Brian Luft wrote:

Does Cocoa use a geometry-style coordinate system with (0, 0) at the lower left corner?
---Yes. I recall reading this, but I cannot quote you where. 0,0 is lower left, +Y is up. Just like they taught you in fifth grade math.
Computer screens have always been "wrong", because the scan line moves from top to bottom, video ram addresses increase from top to bottom, so it seemed natural to number the coordinates from top to bottom. Cocoa has finally "corrected" this.


How do I flip this?
Set the control's Y coordinate to (WindowHeight - ControlHeight - Y).
Or just change your thinking.

Also, why would the controls be stuck to the bottom of the window?
--- because the control's Y position is Y pixels from the bottom of the window. If the window expands downward, the control moves downward.

Note that these controls were instanciated from another .nib and dynamically added to the window, not statically added in interface builder.
--- Immaterial. The coordinate system is the same.

-------------------------------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175


  • Follow-Ups:
    • Re: coordinate system
      • From: Ondra Cada <email@hidden>
References: 
 >coordinate system (From: Brian Luft <email@hidden>)

  • Prev by Date: coordinate system
  • Next by Date: Changing Desktop picture from Cocoa app in 10.1 without re-starting Finder [Again]
  • Previous by thread: coordinate system
  • Next by thread: Re: coordinate system
  • Index(es):
    • Date
    • Thread