Address review comments

This commit is contained in:
stefnotch
2021-02-21 20:50:21 +01:00
parent 7f5903584e
commit 0a9e9e6695
4 changed files with 6 additions and 6 deletions

View File

@@ -555,17 +555,17 @@ public:
API_PROPERTY() static BatteryInfo GetBatteryInfo();
/// <summary>
/// Gets the screen DPI setting.
/// Gets the primary monitor's DPI setting.
/// </summary>
API_PROPERTY() static int32 GetDpi();
/// <summary>
/// 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.
/// </summary>
API_PROPERTY() static float GetDpiScale();
/// <summary>
/// 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).
/// </summary>
API_FIELD() static float CustomDpiScale;

View File

@@ -310,7 +310,7 @@ namespace FlaxEngine.GUI
/// <summary>
/// Gets the GUI window root control which contains that control (or null if not linked to any).
/// </summary>
public virtual WindowRootControl RootWindow => _parent?.RootWindow; // TODO: Why doesn't this just go "_root?.RootWindow" or something?
public virtual WindowRootControl RootWindow => _root?.RootWindow;
/// <summary>
/// Gets screen position of the control (upper left corner).

View File

@@ -221,7 +221,7 @@ namespace FlaxEngine.GUI
/// </summary>
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)