mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Correctly handle anchor/origin changes as undo states
This commit is contained in:
@ -241,6 +241,8 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
private void applyOrigins(Anchor origin)
|
private void applyOrigins(Anchor origin)
|
||||||
{
|
{
|
||||||
|
OnOperationBegan();
|
||||||
|
|
||||||
foreach (var item in SelectedItems)
|
foreach (var item in SelectedItems)
|
||||||
{
|
{
|
||||||
var drawable = (Drawable)item;
|
var drawable = (Drawable)item;
|
||||||
@ -255,6 +257,8 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
ApplyClosestAnchor(drawable);
|
ApplyClosestAnchor(drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnOperationEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -266,6 +270,8 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
private void applyFixedAnchors(Anchor anchor)
|
private void applyFixedAnchors(Anchor anchor)
|
||||||
{
|
{
|
||||||
|
OnOperationBegan();
|
||||||
|
|
||||||
foreach (var item in SelectedItems)
|
foreach (var item in SelectedItems)
|
||||||
{
|
{
|
||||||
var drawable = (Drawable)item;
|
var drawable = (Drawable)item;
|
||||||
@ -273,15 +279,21 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
item.UsesFixedAnchor = true;
|
item.UsesFixedAnchor = true;
|
||||||
applyAnchor(drawable, anchor);
|
applyAnchor(drawable, anchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnOperationEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyClosestAnchors()
|
private void applyClosestAnchors()
|
||||||
{
|
{
|
||||||
|
OnOperationBegan();
|
||||||
|
|
||||||
foreach (var item in SelectedItems)
|
foreach (var item in SelectedItems)
|
||||||
{
|
{
|
||||||
item.UsesFixedAnchor = false;
|
item.UsesFixedAnchor = false;
|
||||||
ApplyClosestAnchor((Drawable)item);
|
ApplyClosestAnchor((Drawable)item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnOperationEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Anchor getClosestAnchor(Drawable drawable)
|
private static Anchor getClosestAnchor(Drawable drawable)
|
||||||
|
Reference in New Issue
Block a user