make code a bit nicer

This commit is contained in:
Saas
2026-05-21 00:26:45 +02:00
parent 5010597bd2
commit 637f3dc176
+10 -7
View File
@@ -185,17 +185,20 @@ internal class DirectionGizmo : ContainerControl
/// <inheritdoc />
public override bool OnMouseUp(Float2 location, MouseButton button)
{
if (_mouseDown && _mouseDownLocation != location)
if (_mouseDown)
{
_mouseDown = false;
EndMouseCapture();
Root.MousePosition = PointToParent(Root, _mouseDownLocation);
Cursor = CursorType.Default;
return true;
if (_mouseDownLocation != location)
{
_mouseDown = false;
EndMouseCapture();
Root.MousePosition = PointToParent(Root, _mouseDownLocation);
Cursor = CursorType.Default;
return true;
}
}
_mouseDown = false;
if (base.OnMouseUp(location, button))
return true;