Unscale the window size on resize if we are doing automatic HighDPI scaling.

This commit is contained in:
Jeffery Myers
2025-03-12 14:16:50 -07:00
parent b80250bee4
commit 4bed3741c1
3 changed files with 31 additions and 5 deletions

View File

@ -1753,8 +1753,14 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
if (IsWindowFullscreen()) return;
// Set current screen size
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
{
width = (int)(width / GetWindowScaleDPI().x);
height = (int)(height / GetWindowScaleDPI().y);
}
// Set current screen size
CORE.Window.screen.width = width;
CORE.Window.screen.height = height;