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

Fix control point additions without a drag not being undoable

This commit is contained in:
Bartłomiej Dach 2021-12-23 09:19:21 +01:00
parent cbda637d66
commit c6a5ac1c5f
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -139,6 +139,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
case MouseButton.Left: case MouseButton.Left:
if (e.ControlPressed && IsSelected) if (e.ControlPressed && IsSelected)
{ {
changeHandler?.BeginChange();
placementControlPoint = addControlPoint(e.MousePosition); placementControlPoint = addControlPoint(e.MousePosition);
ControlPointVisualiser?.SetSelectionTo(placementControlPoint); ControlPointVisualiser?.SetSelectionTo(placementControlPoint);
return true; // Stop input from being handled and modifying the selection return true; // Stop input from being handled and modifying the selection
@ -153,16 +154,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
[CanBeNull] [CanBeNull]
private PathControlPoint placementControlPoint; private PathControlPoint placementControlPoint;
protected override bool OnDragStart(DragStartEvent e) protected override bool OnDragStart(DragStartEvent e) => placementControlPoint != null;
{
if (placementControlPoint != null)
{
changeHandler?.BeginChange();
return true;
}
return false;
}
protected override void OnDrag(DragEvent e) protected override void OnDrag(DragEvent e)
{ {