1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Fix undo history not being batched correctly for depth change operations

This commit is contained in:
Dean Herbert 2023-02-23 20:03:36 +09:00
parent 32a9c066df
commit c48aceb055

View File

@ -566,6 +566,8 @@ namespace osu.Game.Overlays.SkinEditor
if (getTarget(selectedTarget.Value) is not SkinComponentsContainer target)
return;
changeHandler?.BeginChange();
// Iterating by target components order ensures we maintain the same order across selected components, regardless
// of the order they were selected in.
foreach (var d in target.Components.ToArray())
@ -579,6 +581,8 @@ namespace osu.Game.Overlays.SkinEditor
SelectedComponents.Add(d);
target.Add(d);
}
changeHandler?.EndChange();
}
public void SendSelectionToBack()
@ -586,6 +590,8 @@ namespace osu.Game.Overlays.SkinEditor
if (getTarget(selectedTarget.Value) is not SkinComponentsContainer target)
return;
changeHandler?.BeginChange();
foreach (var d in target.Components.ToArray())
{
if (SelectedComponents.Contains(d))
@ -594,6 +600,8 @@ namespace osu.Game.Overlays.SkinEditor
target.Remove(d, false);
target.Add(d);
}
changeHandler?.EndChange();
}
#region Drag & drop import handling