mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Avoid using guesses to determine whether inputs blocked
This commit is contained in:
@ -110,9 +110,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
bool selectionPerformed = performMouseDownActions(e);
|
||||
|
||||
// even if a selection didn't occur, a drag event may still move the selection.
|
||||
prepareSelectionMovement();
|
||||
bool movementPossible = prepareSelectionMovement();
|
||||
|
||||
return selectionPerformed || e.Button == MouseButton.Left;
|
||||
return selectionPerformed || movementPossible;
|
||||
}
|
||||
|
||||
protected SelectionBlueprint<T> ClickedBlueprint { get; private set; }
|
||||
@ -427,19 +427,21 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <summary>
|
||||
/// Attempts to begin the movement of any selected blueprints.
|
||||
/// </summary>
|
||||
private void prepareSelectionMovement()
|
||||
/// <returns>Whether a movement is possible.</returns>
|
||||
private bool prepareSelectionMovement()
|
||||
{
|
||||
if (!SelectionHandler.SelectedBlueprints.Any())
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Any selected blueprint that is hovered can begin the movement of the group, however only the first item (according to SortForMovement) is used for movement.
|
||||
// A special case is added for when a click selection occurred before the drag
|
||||
if (!clickSelectionBegan && !SelectionHandler.SelectedBlueprints.Any(b => b.IsHovered))
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Movement is tracked from the blueprint of the earliest item, since it only makes sense to distance snap from that item
|
||||
movementBlueprints = SortForMovement(SelectionHandler.SelectedBlueprints).ToArray();
|
||||
movementBlueprintOriginalPositions = movementBlueprints.Select(m => m.ScreenSpaceSelectionPoint).ToArray();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user