mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
parent
04a439a0a0
commit
41287694cb
|
@ -1164,8 +1164,14 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||||
|
const NSRect localRect = NSMakeRect(x, contentRect.size.height - y - 1, 0, 0);
|
||||||
|
const NSRect globalRect = [window->ns.object convertRectToScreen:localRect];
|
||||||
|
const NSPoint globalPoint = globalRect.origin;
|
||||||
|
#else
|
||||||
const NSPoint localPoint = NSMakePoint(x, contentRect.size.height - y - 1);
|
const NSPoint localPoint = NSMakePoint(x, contentRect.size.height - y - 1);
|
||||||
const NSPoint globalPoint = [window->ns.object convertBaseToScreen:localPoint];
|
const NSPoint globalPoint = [window->ns.object convertBaseToScreen:localPoint];
|
||||||
|
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||||
|
|
||||||
CGWarpMouseCursorPosition(CGPointMake(globalPoint.x,
|
CGWarpMouseCursorPosition(CGPointMake(globalPoint.x,
|
||||||
transformY(globalPoint.y)));
|
transformY(globalPoint.y)));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user