Extract storable attributes to bindables

This commit is contained in:
Dean Herbert
2021-04-28 14:21:07 +09:00
parent 99b428ee4b
commit 74fb7cd180
2 changed files with 34 additions and 17 deletions

View File

@ -111,7 +111,7 @@ namespace osu.Game.Tests.Visual.Gameplay
public override bool HandleRotation(float angle)
{
foreach (var c in SelectedBlueprints)
c.Item.Rotation += angle;
c.Item.SkinRotation.Value += angle;
return base.HandleRotation(angle);
}
@ -121,11 +121,18 @@ namespace osu.Game.Tests.Visual.Gameplay
adjustScaleFromAnchor(ref scale, anchor);
foreach (var c in SelectedBlueprints)
c.Item.Scale += scale * 0.01f;
c.Item.SkinScale.Value += scale.X * 0.01f;
return true;
}
public override bool HandleMovement(MoveSelectionEvent<SkinnableHUDComponent> moveEvent)
{
foreach (var c in SelectedBlueprints)
c.Item.SkinPosition.Value += moveEvent.InstantDelta.X;
return true;
}
private static void adjustScaleFromAnchor(ref Vector2 scale, Anchor reference)
{
// cancel out scale in axes we don't care about (based on which drag handle was used).
@ -136,13 +143,6 @@ namespace osu.Game.Tests.Visual.Gameplay
if ((reference & Anchor.x0) > 0) scale.X = -scale.X;
if ((reference & Anchor.y0) > 0) scale.Y = -scale.Y;
}
public override bool HandleMovement(MoveSelectionEvent<SkinnableHUDComponent> moveEvent)
{
foreach (var c in SelectedBlueprints)
c.Item.Position += moveEvent.InstantDelta;
return true;
}
}
protected override SelectionBlueprint<SkinnableHUDComponent> CreateBlueprintFor(SkinnableHUDComponent component)