Fix mouse leave event handling to restore cursor

#759
This commit is contained in:
Wojtek Figat
2022-10-10 18:47:38 +02:00
parent 0ed41f97fc
commit ebd88a407d
2 changed files with 22 additions and 2 deletions

View File

@@ -173,8 +173,11 @@ namespace FlaxEditor.GUI.Input
{
_isSliding = false;
EndMouseCapture();
Cursor = CursorType.Default;
_cursorChanged = false;
if (_cursorChanged)
{
Cursor = CursorType.Default;
_cursorChanged = false;
}
SlidingEnd?.Invoke();
}
@@ -300,6 +303,18 @@ namespace FlaxEditor.GUI.Input
return base.OnMouseUp(location, button);
}
/// <inheritdoc />
public override void OnMouseLeave()
{
if (_cursorChanged)
{
Cursor = CursorType.Default;
_cursorChanged = false;
}
base.OnMouseLeave();
}
/// <inheritdoc />
protected override void OnEditBegin()
{