diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs b/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs index 57aeccbc7..247844659 100644 --- a/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs +++ b/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs @@ -124,7 +124,7 @@ namespace FlaxEditor.GUI.ContextMenu PerformLayout(); // Calculate popup direction and initial location (fit on a single monitor) - var dpiScale = parentWin.Window.DpiScale; + var dpiScale = parentWin.DpiScale; Vector2 dpiSize = Size * dpiScale; Vector2 locationWS = parent.PointToWindow(location); Vector2 locationSS = parentWin.PointToScreen(locationWS); diff --git a/Source/Editor/GUI/Docking/DockPanel.cs b/Source/Editor/GUI/Docking/DockPanel.cs index 23b70f719..16f6f9a47 100644 --- a/Source/Editor/GUI/Docking/DockPanel.cs +++ b/Source/Editor/GUI/Docking/DockPanel.cs @@ -124,7 +124,7 @@ namespace FlaxEditor.GUI.Docking throw new InvalidOperationException("Missing parent window."); var control = _tabsProxy != null ? (Control)_tabsProxy : this; var clientPos = control.PointToWindow(Vector2.Zero); - return new Rectangle(parentWin.PointToScreen(clientPos), control.Size * RootWindow.Window.DpiScale); + return new Rectangle(parentWin.PointToScreen(clientPos), control.Size * RootWindow.DpiScale); } } diff --git a/Source/Editor/Surface/ContextMenu/ContentFinder.cs b/Source/Editor/Surface/ContextMenu/ContentFinder.cs index fd986f4f5..6089c2ca7 100644 --- a/Source/Editor/Surface/ContextMenu/ContentFinder.cs +++ b/Source/Editor/Surface/ContextMenu/ContentFinder.cs @@ -108,7 +108,7 @@ namespace FlaxEditor.Surface.ContextMenu { _resultPanel.DisposeChildren(); - var dpiScale = RootWindow.Window.DpiScale; + var dpiScale = RootWindow.DpiScale; if (items.Count == 0) { diff --git a/Source/Engine/UI/GUI/Tooltip.cs b/Source/Engine/UI/GUI/Tooltip.cs index fca4bd645..4729ece88 100644 --- a/Source/Engine/UI/GUI/Tooltip.cs +++ b/Source/Engine/UI/GUI/Tooltip.cs @@ -68,7 +68,7 @@ namespace FlaxEngine.GUI var parentWin = target.Root; if (parentWin == null) return; - float dpiScale = target.RootWindow.Window.DpiScale; + float dpiScale = target.RootWindow.DpiScale; Vector2 dpiSize = Size * dpiScale; Vector2 locationWS = target.PointToWindow(location); Vector2 locationSS = parentWin.PointToScreen(locationWS); diff --git a/Source/Engine/UI/GUI/WindowRootControl.cs b/Source/Engine/UI/GUI/WindowRootControl.cs index 1e9785195..a8028ebe8 100644 --- a/Source/Engine/UI/GUI/WindowRootControl.cs +++ b/Source/Engine/UI/GUI/WindowRootControl.cs @@ -55,6 +55,11 @@ namespace FlaxEngine.GUI /// public bool IsMaximized => _window.IsMaximized; + /// + /// Gets the window DPI scale factor (1 is default). Includes custom DPI scale + /// + public float DpiScale => _window.DpiScale; + internal WindowRootControl(Window window) { _window = window;