1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 15:23:01 +01:00

Keep options window centred after a resize (#22026)

This commit is contained in:
Aaron van Geffen
2024-05-12 23:07:32 +02:00
committed by GitHub
parent 59297f0038
commit 4ffe00aaba
2 changed files with 9 additions and 0 deletions

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();
}