Disallow selections to be moved outside of the playfield

This commit is contained in:
smoogipoo
2019-11-06 17:27:41 +09:00
parent c631a05a44
commit 2c1bfd62ef
4 changed files with 29 additions and 8 deletions

View File

@ -367,7 +367,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
(Vector2 snappedPosition, double snappedTime) = composer.GetSnappedPosition(ToLocalSpace(movePosition), draggedObject.StartTime);
// Move the hitobjects
selectionHandler.HandleMovement(new MoveSelectionEvent(movementBlueprint, startPosition, ToScreenSpace(snappedPosition)));
if (!selectionHandler.HandleMovement(new MoveSelectionEvent(movementBlueprint, startPosition, ToScreenSpace(snappedPosition))))
return true;
// Apply the start time at the newly snapped-to position
double offset = snappedTime - draggedObject.StartTime;