Keep options window centred after a resize (#22026)

This commit is contained in:
Aaron van Geffen authored and GitHub committed 2024-05-12 21:07:32 +00:00
1 parent 59297f0038
commit 4ffe00aaba
2 files changed
+9

No files matched your search

+8
View File
@@ -1402,6 +1402,14 @@ void WindowResizeGui(int32_t width, int32_t height)
optionsWind->windowPos.x = width - 80;
}
// Keep options window centred after a resize
WindowBase* optionsWindow = WindowFindByClass(WindowClass::Options);
if (optionsWindow != nullptr)
{
optionsWindow->windowPos.x = (ContextGetWidth() - optionsWindow->width) / 2;
optionsWindow->windowPos.y = (ContextGetHeight() - optionsWindow->height) / 2;
}
GfxInvalidateScreen();
}