1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Merge branch 'editor-fix-multiple-selection' into editor-clipboard

This commit is contained in:
Dean Herbert 2020-09-14 15:47:20 +09:00
commit 62c55165d4

View File

@ -145,16 +145,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <param name="blueprint">The blueprint.</param>
internal void HandleSelected(SelectionBlueprint blueprint)
{
if (!selectedBlueprints.Contains(blueprint))
{
selectedBlueprints.Add(blueprint);
selectedBlueprints.Add(blueprint);
// need to check this as well, as there are potentially multiple SelectionHandlers and the above check is not enough.
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
// there are potentially multiple SelectionHandlers active, but we only want to add hitobjects to the selected list once.
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
UpdateVisibility();
}
UpdateVisibility();
}
/// <summary>
@ -163,12 +160,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <param name="blueprint">The blueprint.</param>
internal void HandleDeselected(SelectionBlueprint blueprint)
{
if (selectedBlueprints.Remove(blueprint))
{
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
selectedBlueprints.Remove(blueprint);
UpdateVisibility();
}
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
UpdateVisibility();
}
/// <summary>