How are you getting your global point? There are non-Cocoa parts of the OS that do use top-left instead of bottom-left origins, so those will need converting. ________________________________________ From: cocoa-dev-bounces+lrucker=vmware....@lists.apple.com [cocoa-dev-bounces+lrucker=vmware....@lists.apple.com] on behalf of Dave [d...@looktowindward.com] Sent: Tuesday, April 21, 2015 8:53 AM To: Cocoa Developers Subject: Converting to Window Coordinates
I meant add this: Global: {183.45703125, 92.41015625} Window: {183.45703125, -619.58984375} These are the values I get when I run the code. From looking at Y it looks like I need to flip the Y Coordinate, but I’m not sure where/how to do this? TheY = 92 on the Global Point represents a point near the top of the Screen. Cheers Dave Hi All, I have the following code in a Window Controller. myWorkRect.origin = theGlobalPoint; myWorkRect.size = NSMakeSize(1,1); myWorkRect = [self.window convertRectFromScreen:myWorkRect]; myWindowPoint = myWorkRect.origin; myCocoaControlView = [myContentView hitTest: myWindowPoint]; I have a Point in Global (Screen) space and I want to check if that point is inside a view of the associated window. I had hoped the code above would do the trick but it seems not. The Global point is within a View in the Window, and when this code gets called hitTest always returned the Frame View (not the deepest View that intersects the point) as the documentation says, just to see what would happen, I overrode hitTest in the Content View and now it returns nil. What am I do doing wrong? Thanks a lot for any help, All the Best Dave _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com This email sent to lruc...@vmware.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com