Fix auto-docking windows on open when system DPI scale is not 1

This commit is contained in:
Wojtek Figat
2023-12-27 00:29:30 +01:00
parent 4a42aa8c44
commit 4d9ef32abc
2 changed files with 6 additions and 7 deletions

View File

@@ -676,7 +676,9 @@ namespace FlaxEditor.Modules
if (newLocation == DockState.Float)
{
// Check if there is a floating window that has the same size
var defaultSize = window.DefaultSize;
var dpi = (float)Platform.Dpi / 96.0f;
var dpiScale = Platform.CustomDpiScale;
var defaultSize = window.DefaultSize * dpi;
for (var i = 0; i < Editor.UI.MasterPanel.FloatingPanels.Count; i++)
{
var win = Editor.UI.MasterPanel.FloatingPanels[i];
@@ -688,7 +690,7 @@ namespace FlaxEditor.Modules
}
}
window.ShowFloating(defaultSize);
window.ShowFloating(defaultSize * dpiScale);
}
else
{