mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 15:23:17 +01:00
Cocoa: Fix coordinate transformations
Window relative mouse locations provided via NSWindow and NSEvent are based at 0,1 while screen relative locations use 0,0. Incorrect handling of this had crept into other coordinate transformations. Note that most of these errors canceled each other out, so the reported positions of windows, monitors and work areas are unaffected. This corrects the cursor position for glfwGetCursorPos and glfwSetCursorPos. Fixes #1461.
This commit is contained in:
committed by
Camilla Löwy
parent
d0b7f539e2
commit
3c3981a4f0
@@ -430,7 +430,7 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
|
||||
if (xpos)
|
||||
*xpos = frameRect.origin.x;
|
||||
if (ypos)
|
||||
*ypos = _glfwTransformYNS(frameRect.origin.y + frameRect.size.height);
|
||||
*ypos = _glfwTransformYNS(frameRect.origin.y + frameRect.size.height - 1);
|
||||
if (width)
|
||||
*width = frameRect.size.width;
|
||||
if (height)
|
||||
|
||||
Reference in New Issue
Block a user