Fix tooltip location check when wraps over the screen

#2016
This commit is contained in:
Wojtek Figat
2023-12-07 11:43:50 +01:00
parent 3749b35aba
commit 228239632a

View File

@@ -207,19 +207,20 @@ namespace FlaxEngine.GUI
/// <inheritdoc />
public override void Update(float deltaTime)
{
// Move window with mouse location
var mousePos = Input.MouseScreenPosition;
WrapPosition(ref mousePos, 10);
if (_window)
_window.Position = mousePos + new Float2(15, 10);
// Auto hide if mouse leaves control area
var location = _showTarget.PointFromScreen(mousePos);
if (!_showTarget.OnTestTooltipOverControl(ref location))
{
// Mouse left or sth
// Auto hide if mouse leaves control area
Hide();
}
else
{
// Position tooltip when mouse moves
WrapPosition(ref mousePos, 10);
if (_window)
_window.Position = mousePos + new Float2(15, 10);
}
base.Update(deltaTime);
}