mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 10:05:10 +00:00
Win32: Handle content scale error on creation
Only apply the content scale to the initial size of the window if content scale retrieval succeeded. Related to #1615.
This commit is contained in:
parent
fbfd7e65c8
commit
53d86c64d7
@ -1304,8 +1304,12 @@ static int createNativeWindow(_GLFWwindow* window,
|
||||
{
|
||||
float xscale, yscale;
|
||||
_glfwGetWindowContentScaleWin32(window, &xscale, &yscale);
|
||||
rect.right = (int) (rect.right * xscale);
|
||||
rect.bottom = (int) (rect.bottom * yscale);
|
||||
|
||||
if (xscale > 0.f && yscale > 0.f)
|
||||
{
|
||||
rect.right = (int) (rect.right * xscale);
|
||||
rect.bottom = (int) (rect.bottom * yscale);
|
||||
}
|
||||
}
|
||||
|
||||
ClientToScreen(window->win32.handle, (POINT*) &rect.left);
|
||||
|
Loading…
Reference in New Issue
Block a user