Add DpiScale to RootWindow
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
||||
{
|
||||
_resultPanel.DisposeChildren();
|
||||
|
||||
var dpiScale = RootWindow.Window.DpiScale;
|
||||
var dpiScale = RootWindow.DpiScale;
|
||||
|
||||
if (items.Count == 0)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user