Move bounds check from moveSelection to HandleMovement

This commit is contained in:
Leon Gebler 2021-02-21 17:38:50 +01:00
parent 562a4cefdb
commit 2c6f92d12f
1 changed files with 6 additions and 4 deletions

View File

@ -35,8 +35,12 @@ protected override void OnOperationEnded()
referenceOrigin = null;
}
public override bool HandleMovement(MoveSelectionEvent moveEvent) =>
moveSelection(moveEvent.InstantDelta);
public override bool HandleMovement(MoveSelectionEvent moveEvent)
{
bool result = moveSelection(moveEvent.InstantDelta);
moveSelectionInBounds();
return result;
}
/// <summary>
/// During a transform, the initial origin is stored so it can be used throughout the operation.
@ -234,8 +238,6 @@ private bool moveSelection(Vector2 delta)
foreach (var h in hitObjects)
h.Position += delta;
moveSelectionInBounds();
return true;
}