Fix game window resize to maintain placement within screen (eg. centered)

#3699
This commit is contained in:
2026-08-05 20:41:48 +02:00
parent 70498fa42c
commit abb5de31df
+5 -1
View File
@@ -271,7 +271,11 @@ void ScreenService::Draw()
auto win = Engine::MainWindow;
if (win)
{
win->SetClientSize(Size.GetValue());
Float2 sizeDelta = Size.GetValue() - win->GetClientSize();
Rectangle newBiunds(win->GetClientPosition(), Size.GetValue());
if (!win->IsMaximized())
newBiunds -= sizeDelta * 0.5f;
win->SetClientBounds(newBiunds);
}
Size.Reset();