From d19b799f44edafd9b04c362a7e00bc65c38c0c69 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 4 Nov 2020 17:53:03 +0900 Subject: [PATCH] Invert boolean logic --- .../Edit/Compose/Components/BlueprintContainer.cs | 9 +++++---- .../Screens/Edit/Compose/Components/SelectionHandler.cs | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs b/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs index d8f7137fa6..e7da220946 100644 --- a/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs +++ b/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs @@ -116,7 +116,7 @@ namespace osu.Game.Screens.Edit.Compose.Components protected override bool OnMouseDown(MouseDownEvent e) { - if (beginClickSelection(e)) return true; + if (!beginClickSelection(e)) return true; prepareSelectionMovement(); @@ -292,23 +292,24 @@ namespace osu.Game.Screens.Edit.Compose.Components /// Attempts to select any hovered blueprints. /// /// The input event that triggered this selection. + /// Whether a selection was performed. private bool beginClickSelection(MouseButtonEvent e) { Debug.Assert(!clickSelectionBegan); - bool rightClickHandled = false; + bool selectedPerformed = true; foreach (SelectionBlueprint blueprint in SelectionBlueprints.AliveChildren) { if (blueprint.IsHovered) { - rightClickHandled |= SelectionHandler.HandleSelectionRequested(blueprint, e.CurrentState); + selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e.CurrentState); clickSelectionBegan = true; break; } } - return rightClickHandled; + return selectedPerformed; } /// diff --git a/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs b/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs index 5bf6c52e11..d5c83576e2 100644 --- a/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs +++ b/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs @@ -219,13 +219,13 @@ namespace osu.Game.Screens.Edit.Compose.Components /// /// The blueprint. /// The input state at the point of selection. - /// Whether right click was handled. + /// Whether a selection was performed. internal bool HandleSelectionRequested(SelectionBlueprint blueprint, InputState state) { if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right)) { handleQuickDeletion(blueprint); - return true; + return false; } if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left)) @@ -233,7 +233,7 @@ namespace osu.Game.Screens.Edit.Compose.Components else ensureSelected(blueprint); - return false; + return true; } private void handleQuickDeletion(SelectionBlueprint blueprint)