Re: Converting HIPoints to CGPoints/NSPoints in global space?
Re: Converting HIPoints to CGPoints/NSPoints in global space?
- Subject: Re: Converting HIPoints to CGPoints/NSPoints in global space?
- From: Dave MacLachlan <email@hidden>
- Date: Tue, 14 Feb 2006 08:48:56 -0800
Thanks Raleigh...
However, this is not always the case. Global carbon HIPoint mouse
coordinates are origin upper left. You must know the source of the
HIPoint to make any judgement on it.
I'm working in global space.
Why are you looping through all the displays? The only one that
matters is the one with the menu bar. If you want to go from Carbon
global space to Cocoa global space, the the bottom left of the
screen with the menu bar is your origin. Use that screen's height
in your calculation.
I wasn't sure that this was the case (and when I was coding the
original version it was on my Powerbook with no external screens to
test on. Now that I've had some time to play, this problem isn't as
tough as I thought it may be.
Short answer:
Get the menu screen height
HIPoint.x == CGPoint.x
HIPoint.y == menu screen height - CGPoint.y
Done!
Cheers,
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden