From 0a9e9e669525892db34d63c8afd574b0c76d081c Mon Sep 17 00:00:00 2001 From: stefnotch Date: Sun, 21 Feb 2021 20:50:21 +0100 Subject: [PATCH] Address review comments --- Source/Editor/Windows/ContentWindow.cs | 2 +- Source/Engine/Platform/Base/PlatformBase.h | 6 +++--- Source/Engine/UI/GUI/Control.cs | 2 +- Source/Engine/UI/GUI/RenderOutputControl.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index 66ed50daf..a0aeb718c 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -368,7 +368,7 @@ namespace FlaxEditor.Windows // Focus content window Focus(); - RootWindow?.Window.Focus(); + RootWindow?.Focus(); } // Refresh database and view now diff --git a/Source/Engine/Platform/Base/PlatformBase.h b/Source/Engine/Platform/Base/PlatformBase.h index d2d34c88f..3a8b93ee7 100644 --- a/Source/Engine/Platform/Base/PlatformBase.h +++ b/Source/Engine/Platform/Base/PlatformBase.h @@ -555,17 +555,17 @@ public: API_PROPERTY() static BatteryInfo GetBatteryInfo(); /// - /// Gets the screen DPI setting. + /// Gets the primary monitor's DPI setting. /// API_PROPERTY() static int32 GetDpi(); /// - /// Gets the screen DPI setting scale factor (1 is default). Includes custom DPI scale. + /// Gets the primary monitor's DPI setting scale factor (1 is default). Includes custom DPI scale. /// API_PROPERTY() static float GetDpiScale(); /// - /// The custom screen DPI scale factor to apply globally. Can be used to adjust the User Interface scale (resolution). + /// The custom DPI scale factor to apply globally. Can be used to adjust the User Interface scale (resolution). /// API_FIELD() static float CustomDpiScale; diff --git a/Source/Engine/UI/GUI/Control.cs b/Source/Engine/UI/GUI/Control.cs index 6f4603e1a..096fb7288 100644 --- a/Source/Engine/UI/GUI/Control.cs +++ b/Source/Engine/UI/GUI/Control.cs @@ -310,7 +310,7 @@ namespace FlaxEngine.GUI /// /// Gets the GUI window root control which contains that control (or null if not linked to any). /// - public virtual WindowRootControl RootWindow => _parent?.RootWindow; // TODO: Why doesn't this just go "_root?.RootWindow" or something? + public virtual WindowRootControl RootWindow => _root?.RootWindow; /// /// Gets screen position of the control (upper left corner). diff --git a/Source/Engine/UI/GUI/RenderOutputControl.cs b/Source/Engine/UI/GUI/RenderOutputControl.cs index fb6897516..c4f3f24b4 100644 --- a/Source/Engine/UI/GUI/RenderOutputControl.cs +++ b/Source/Engine/UI/GUI/RenderOutputControl.cs @@ -221,7 +221,7 @@ namespace FlaxEngine.GUI /// public void SyncBackbufferSize() { - float scale = ResolutionScale * (Root?.RootWindow?.Window?.DpiScale ?? 1); // TODO: Figure this out + float scale = ResolutionScale * (RootWindow?.DpiScale ?? Platform.DpiScale); int width = Mathf.CeilToInt(Width * scale); int height = Mathf.CeilToInt(Height * scale); if (_customResolution.HasValue)