1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 16:55:34 +08:00

Terminate existing anchor drag operations when object is deselected

This commit is contained in:
Bartłomiej Dach 2024-10-15 12:49:24 +02:00
parent 2d0e98c951
commit 1a7acbac33
No known key found for this signature in database

View File

@ -333,6 +333,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
base.Dispose(isDisposing); base.Dispose(isDisposing);
foreach (var p in Pieces) foreach (var p in Pieces)
p.ControlPoint.Changed -= controlPointChanged; p.ControlPoint.Changed -= controlPointChanged;
if (draggedControlPointIndex >= 0)
DragEnded();
} }
private void selectionRequested(PathControlPointPiece<T> piece, MouseButtonEvent e) private void selectionRequested(PathControlPointPiece<T> piece, MouseButtonEvent e)
@ -392,7 +395,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
private Vector2[] dragStartPositions; private Vector2[] dragStartPositions;
private PathType?[] dragPathTypes; private PathType?[] dragPathTypes;
private int draggedControlPointIndex; private int draggedControlPointIndex = -1;
private HashSet<PathControlPoint> selectedControlPoints; private HashSet<PathControlPoint> selectedControlPoints;
private List<MenuItem> curveTypeItems; private List<MenuItem> curveTypeItems;
@ -473,7 +476,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
EnsureValidPathTypes(); EnsureValidPathTypes();
} }
public void DragEnded() => changeHandler?.EndChange(); public void DragEnded()
{
changeHandler?.EndChange();
draggedControlPointIndex = -1;
}
#endregion #endregion