1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-02 01:43:21 +08:00

Terminate existing anchor create operation when object is deselected

This commit is contained in:
Bartłomiej Dach 2024-10-15 12:54:08 +02:00
parent 1a7acbac33
commit 232301f27d
No known key found for this signature in database

View File

@ -178,6 +178,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
{ {
base.OnDeselected(); base.OnDeselected();
if (placementControlPoint != null)
endControlPointPlacement();
updateVisualDefinition(); updateVisualDefinition();
BodyPiece.RecyclePath(); BodyPiece.RecyclePath();
} }
@ -377,6 +380,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
protected override void OnMouseUp(MouseUpEvent e) protected override void OnMouseUp(MouseUpEvent e)
{ {
if (placementControlPoint != null) if (placementControlPoint != null)
endControlPointPlacement();
}
private void endControlPointPlacement()
{ {
if (IsDragged) if (IsDragged)
ControlPointVisualiser?.DragEnded(); ControlPointVisualiser?.DragEnded();
@ -384,7 +391,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
placementControlPoint = null; placementControlPoint = null;
changeHandler?.EndChange(); changeHandler?.EndChange();
} }
}
protected override bool OnKeyDown(KeyDownEvent e) protected override bool OnKeyDown(KeyDownEvent e)
{ {