mirror of
https://github.com/ppy/osu
synced 2025-01-19 04:20:59 +00:00
More removal of "drag"
This commit is contained in:
parent
8b661e624d
commit
c1db11fa06
@ -46,9 +46,9 @@ namespace osu.Game.Rulesets.Edit
|
||||
public readonly DrawableHitObject HitObject;
|
||||
|
||||
/// <summary>
|
||||
/// The screen-space position of <see cref="HitObject"/> when a drag was started.
|
||||
/// The screen-space position of <see cref="HitObject"/> prior to handling a movement event.
|
||||
/// </summary>
|
||||
public Vector2 ScreenSpaceDragStartPosition { get; private set; }
|
||||
internal Vector2 ScreenSpaceMovementStartPosition { get; private set; }
|
||||
|
||||
protected override bool ShouldBeAlive => (HitObject.IsAlive && HitObject.IsPresent) || State == SelectionState.Selected;
|
||||
public override bool HandlePositionalInput => ShouldBeAlive;
|
||||
@ -138,7 +138,7 @@ namespace osu.Game.Rulesets.Edit
|
||||
|
||||
protected override bool OnDragStart(DragStartEvent e)
|
||||
{
|
||||
ScreenSpaceDragStartPosition = HitObject.ToScreenSpace(HitObject.OriginPosition);
|
||||
ScreenSpaceMovementStartPosition = HitObject.ToScreenSpace(HitObject.OriginPosition);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -218,11 +218,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
private void onDragRequested(SelectionBlueprint blueprint, DragEvent dragEvent)
|
||||
{
|
||||
var dragPosition = blueprint.ScreenSpaceDragStartPosition + dragEvent.ScreenSpaceMousePosition - dragEvent.ScreenSpaceMouseDownPosition;
|
||||
var movePosition = blueprint.ScreenSpaceMovementStartPosition + dragEvent.ScreenSpaceMousePosition - dragEvent.ScreenSpaceMouseDownPosition;
|
||||
|
||||
// Todo: Snap dragPosition
|
||||
|
||||
selectionHandler.HandleMovement(new MoveSelectionEvent(blueprint, blueprint.ScreenSpaceDragStartPosition, dragPosition));
|
||||
selectionHandler.HandleMovement(new MoveSelectionEvent(blueprint, blueprint.ScreenSpaceMovementStartPosition, movePosition));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Loading…
Reference in New Issue
Block a user