• 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: Event Objects Return 1-Based Y Coordinate Values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Event Objects Return 1-Based Y Coordinate Values


  • Subject: Re: Event Objects Return 1-Based Y Coordinate Values
  • From: Bill Cheeseman <email@hidden>
  • Date: Mon, 27 Jun 2011 14:00:12 -0400

On Jun 27, 2011, at 1:26 PM, Raleigh Ledet wrote:

> Cocoa coordinates are all 0,0 based. If you have a reproducible test case that says otherwise, please file a radar and attach it.
>
> -raleigh
>
>
> On Jun 25, 2011, at 7:59 AM, Richard Somers wrote:
>
>> The Cocoa Drawing Guide states "Cocoa event objects return y coordinate values that are 1-based instead of 0-based. Thus, a mouse click on the bottom left corner of a window or view would yield the point (0, 1) in Cocoa and not (0, 0). Only y-coordinates are 1-based."
>>
>> Why are the y-coordianate values of Cocoa event objects 1-based?
>>
>> Do most developers simply subtract 1.0 from the y-coordianate value obtained from an event object to make it 0-based before using the x-y-coordinate val


I think the OP misunderstood the document. Although Cocoa coordinates are 0-based, the 0 point on the Y axis of the screen is just beyond the bottom of the screen. That is, if you click at the bottom of the screen, the Y coordinate will be 1. 0 is still a valid Y coordinate. I'm not aware that programmers make any overall adjustments of coordinates for this. They just remember that the bottommost clickable Y coordinate is 0.

--

Bill Cheeseman - email@hidden

_______________________________________________

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

References: 
 >Event Objects Return 1-Based Y Coordinate Values (From: Richard Somers <email@hidden>)
 >Re: Event Objects Return 1-Based Y Coordinate Values (From: Raleigh Ledet <email@hidden>)

  • Prev by Date: Re: Event Objects Return 1-Based Y Coordinate Values
  • Next by Date: Re: Event Objects Return 1-Based Y Coordinate Values
  • Previous by thread: Re: Event Objects Return 1-Based Y Coordinate Values
  • Next by thread: Re: Event Objects Return 1-Based Y Coordinate Values
  • Index(es):
    • Date
    • Thread