@@ -323,7 +323,7 @@ namespace FlaxEngine.GUI
|
||||
if (parentWin == null)
|
||||
throw new InvalidOperationException("Missing parent window.");
|
||||
var clientPos = PointToWindow(Vector2.Zero);
|
||||
return parentWin.ClientToScreen(clientPos);
|
||||
return parentWin.PointToScreen(clientPos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1113,12 +1113,12 @@ namespace FlaxEngine.GUI
|
||||
/// </summary>
|
||||
/// <param name="location">Input location of the point to convert</param>
|
||||
/// <returns>Converted point location in screen coordinates</returns>
|
||||
public virtual Vector2 ClientToScreen(Vector2 location)
|
||||
public virtual Vector2 PointToScreen(Vector2 location)
|
||||
{
|
||||
location = PointToParent(ref location);
|
||||
if (_parent != null)
|
||||
{
|
||||
location = _parent.ClientToScreen(location);
|
||||
location = _parent.PointToScreen(location);
|
||||
}
|
||||
return location;
|
||||
}
|
||||
@@ -1128,11 +1128,11 @@ namespace FlaxEngine.GUI
|
||||
/// </summary>
|
||||
/// <param name="location">Input location of the point to convert</param>
|
||||
/// <returns>Converted point location in local control's space</returns>
|
||||
public virtual Vector2 ScreenToClient(Vector2 location)
|
||||
public virtual Vector2 PointFromScreen(Vector2 location)
|
||||
{
|
||||
if (_parent != null)
|
||||
{
|
||||
location = _parent.ScreenToClient(location);
|
||||
location = _parent.PointFromScreen(location);
|
||||
}
|
||||
return PointFromParent(ref location);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace FlaxEngine.GUI
|
||||
float dpiScale = Platform.DpiScale;
|
||||
Vector2 dpiSize = Size * dpiScale;
|
||||
Vector2 locationWS = target.PointToWindow(location);
|
||||
Vector2 locationSS = parentWin.ClientToScreen(locationWS * dpiScale);
|
||||
Vector2 locationSS = parentWin.PointToScreen(locationWS);
|
||||
Vector2 screenSize = Platform.VirtualDesktopSize;
|
||||
Vector2 rightBottomLocationSS = locationSS + dpiSize;
|
||||
if (screenSize.Y < rightBottomLocationSS.Y)
|
||||
@@ -194,7 +194,7 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
// Auto hide if mouse leaves control area
|
||||
Vector2 mousePos = Input.MouseScreenPosition;
|
||||
Vector2 location = _showTarget.ScreenToClient(mousePos);
|
||||
Vector2 location = _showTarget.PointFromScreen(mousePos);
|
||||
if (!_showTarget.OnTestTooltipOverControl(ref location))
|
||||
{
|
||||
// Mouse left or sth
|
||||
|
||||
@@ -232,15 +232,15 @@ namespace FlaxEngine.GUI
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Vector2 ScreenToClient(Vector2 location)
|
||||
public override Vector2 PointFromScreen(Vector2 location)
|
||||
{
|
||||
return _window.ScreenToClient(location) / Platform.DpiScale;
|
||||
return _window.ScreenToClient(location) / _window._dpiScale;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Vector2 ClientToScreen(Vector2 location)
|
||||
public override Vector2 PointToScreen(Vector2 location)
|
||||
{
|
||||
return _window.ClientToScreen(location);
|
||||
return _window.ClientToScreen(location * _window._dpiScale);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user