mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Disallow selections to be moved outside of the playfield (#6742)
Disallow selections to be moved outside of the playfield
This commit is contained in:
@ -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;
|
||||
|
@ -68,9 +68,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// Handles the selected <see cref="DrawableHitObject"/>s being moved.
|
||||
/// </summary>
|
||||
/// <param name="moveEvent">The move event.</param>
|
||||
public virtual void HandleMovement(MoveSelectionEvent moveEvent)
|
||||
{
|
||||
}
|
||||
/// <returns>Whether any <see cref="DrawableHitObject"/>s were moved.</returns>
|
||||
public virtual bool HandleMovement(MoveSelectionEvent moveEvent) => false;
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
|
Reference in New Issue
Block a user