Update blueprint implementation in line with #12625.

This commit is contained in:
Dean Herbert 2021-04-29 15:29:25 +09:00
parent 434e63d629
commit 1516e2ffef
2 changed files with 4 additions and 4 deletions

View File

@ -78,10 +78,8 @@ protected override void Update()
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => drawable.ReceivePositionalInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => drawable.ReceivePositionalInputAt(screenSpacePos);
public override Vector2 ScreenSpaceSelectionPoint => drawable.Parent.ToScreenSpace(drawable.DrawPosition); public override Vector2 ScreenSpaceSelectionPoint => drawable.ScreenSpaceDrawQuad.Centre;
public override Quad SelectionQuad => drawable.ScreenSpaceDrawQuad; public override Quad SelectionQuad => drawable.ScreenSpaceDrawQuad;
public override Vector2 GetInstantDelta(Vector2 screenSpacePosition) => Component.Parent.ToLocalSpace(screenSpacePosition) - drawable.DrawPosition;
} }
} }

View File

@ -6,6 +6,7 @@
using System.Linq; using System.Linq;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Extensions;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Screens.Edit.Compose.Components;
@ -107,7 +108,8 @@ public override bool HandleMovement(MoveSelectionEvent<ISkinnableComponent> move
{ {
foreach (var c in SelectedBlueprints) foreach (var c in SelectedBlueprints)
{ {
((Drawable)c.Item).Position += moveEvent.InstantDelta; Drawable drawable = (Drawable)c.Item;
drawable.Position += drawable.ScreenSpaceDeltaToParentSpace(moveEvent.ScreenSpaceDelta);
} }
return true; return true;