1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Merge pull request #10764 from peppy/fix-editor-quick-delete-via-left-mouse

Fix editor quick delete being triggerable from left mouse button
This commit is contained in:
Dan Balasescu 2020-11-10 17:42:12 +09:00 committed by GitHub
commit 86026ad98f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -303,7 +303,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
if (blueprint.IsHovered)
{
selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e.CurrentState);
selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e);
clickSelectionBegan = true;
break;
}

View File

@ -14,7 +14,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Game.Audio;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
@ -218,17 +218,17 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// Handle a blueprint requesting selection.
/// </summary>
/// <param name="blueprint">The blueprint.</param>
/// <param name="state">The input state at the point of selection.</param>
/// <param name="e">The mouse event responsible for selection.</param>
/// <returns>Whether a selection was performed.</returns>
internal bool HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
internal bool HandleSelectionRequested(SelectionBlueprint blueprint, MouseButtonEvent e)
{
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
if (e.ShiftPressed && e.Button == MouseButton.Right)
{
handleQuickDeletion(blueprint);
return false;
}
if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
if (e.ControlPressed && e.Button == MouseButton.Left)
blueprint.ToggleSelection();
else
ensureSelected(blueprint);