Add DpiScale to RootWindow

This commit is contained in:
stefnotch
2021-02-08 09:48:57 +01:00
parent c7feeb624d
commit 8f8f0266ce
5 changed files with 9 additions and 4 deletions

View File

@@ -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);

View File

@@ -55,6 +55,11 @@ namespace FlaxEngine.GUI
/// </summary>
public bool IsMaximized => _window.IsMaximized;
/// <summary>
/// Gets the window DPI scale factor (1 is default). Includes custom DPI scale
/// </summary>
public float DpiScale => _window.DpiScale;
internal WindowRootControl(Window window)
{
_window = window;