mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:13:21 +08:00
Force placement of in-progress object when changing tools in the editor
This commit is contained in:
parent
f443cfb93e
commit
70e248b927
@ -317,12 +317,16 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
}
|
||||
}
|
||||
|
||||
private void commitIfPlacementActive()
|
||||
{
|
||||
CurrentPlacement?.EndPlacement(CurrentPlacement.PlacementActive == PlacementBlueprint.PlacementState.Active);
|
||||
removePlacement();
|
||||
}
|
||||
|
||||
private void removePlacement()
|
||||
{
|
||||
if (CurrentPlacement == null) return;
|
||||
|
||||
CurrentPlacement.EndPlacement(false);
|
||||
CurrentPlacement.Expire();
|
||||
CurrentPlacement?.EndPlacement(false);
|
||||
CurrentPlacement?.Expire();
|
||||
CurrentPlacement = null;
|
||||
}
|
||||
|
||||
@ -342,7 +346,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
currentTool = value;
|
||||
|
||||
refreshTool();
|
||||
// As per stable editor, when changing tools, we should forcefully commit any pending placement.
|
||||
commitIfPlacementActive();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user