mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 15:25:50 +00:00
Fixed window positioning on OS X.
This commit is contained in:
+3
-2
@@ -937,8 +937,9 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
|
||||
|
||||
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
const NSRect frameRect =
|
||||
[window->ns.object frameRectForContentRect:NSMakeRect(x, y, 0, 0)];
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
const NSRect dummyRect = NSMakeRect(x, transformY(y + contentRect.size.height), 0, 0);
|
||||
const NSRect frameRect = [window->ns.object frameRectForContentRect:dummyRect];
|
||||
[window->ns.object setFrameOrigin:frameRect.origin];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user