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

Correctly handle anchor/origin changes as undo states

This commit is contained in:
Dean Herbert 2023-02-06 15:05:05 +09:00
parent 778b8a9bf7
commit 4c868372a2

View File

@ -241,6 +241,8 @@ namespace osu.Game.Overlays.SkinEditor
private void applyOrigins(Anchor origin)
{
OnOperationBegan();
foreach (var item in SelectedItems)
{
var drawable = (Drawable)item;
@ -255,6 +257,8 @@ namespace osu.Game.Overlays.SkinEditor
ApplyClosestAnchor(drawable);
}
OnOperationEnded();
}
/// <summary>
@ -266,6 +270,8 @@ namespace osu.Game.Overlays.SkinEditor
private void applyFixedAnchors(Anchor anchor)
{
OnOperationBegan();
foreach (var item in SelectedItems)
{
var drawable = (Drawable)item;
@ -273,15 +279,21 @@ namespace osu.Game.Overlays.SkinEditor
item.UsesFixedAnchor = true;
applyAnchor(drawable, anchor);
}
OnOperationEnded();
}
private void applyClosestAnchors()
{
OnOperationBegan();
foreach (var item in SelectedItems)
{
item.UsesFixedAnchor = false;
ApplyClosestAnchor((Drawable)item);
}
OnOperationEnded();
}
private static Anchor getClosestAnchor(Drawable drawable)