Cocoa: Fix glfwSetWindowSize anchor point
This makes glfwSetWindowSize use the top-left corner as anchor point
instead of the bottom-left corner.
Upstream: 7f02898264
This commit is contained in:
parent
9dbc54aad6
commit
c398d3d16e
@ -1638,7 +1638,14 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
|||||||
acquireMonitor(window);
|
acquireMonitor(window);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
[window->ns.object setContentSize:NSMakeSize(width, height)];
|
{
|
||||||
|
NSRect contentRect =
|
||||||
|
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
||||||
|
contentRect.origin.y += contentRect.size.height - height;
|
||||||
|
contentRect.size = NSMakeSize(width, height);
|
||||||
|
[window->ns.object setFrame:[window->ns.object frameRectForContentRect:contentRect]
|
||||||
|
display:YES];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,
|
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user