Change GetGameWindowSize to return game viewport size.

This commit is contained in:
Chandler Cox
2023-02-05 20:22:54 -06:00
parent f4da984399
commit 4b9bbfb663
4 changed files with 1 additions and 42 deletions

View File

@@ -1392,23 +1392,6 @@ namespace FlaxEditor
}
internal void Internal_GetGameWindowSize(out Float2 result)
{
result = new Float2(1280, 720);
var gameWin = Windows.GameWin;
if (gameWin?.Root?.RootWindow is WindowRootControl root)
{
// Handle case when Game window is not selected in tab view
var dockedTo = gameWin.ParentDockPanel;
if (dockedTo != null && dockedTo.SelectedTab != gameWin && dockedTo.SelectedTab != null)
result = dockedTo.SelectedTab.Size * root.DpiScale;
else
result = gameWin.Size * root.DpiScale;
result = Float2.Round(result);
}
}
internal void Internal_GetGameWindowViewportSize(out Float2 result)
{
result = new Float2(1280, 720);
var gameWin = Windows.GameWin;