From cf13cf7225d0f45b0a7ecbff9b6af8e39ad2521f Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Fri, 18 Mar 2022 20:09:55 -0400 Subject: [PATCH] LibGUI: Reset GlyphMapWidget only if clicking a new active glyph Fixes an edge case in which mousing down on the active glyph within a larger selection would reset the selection but fail to update the glyph map. Now we can grow or shrink the selection by dragging the active glyph even after an initial selection is made. --- Userland/Libraries/LibGUI/GlyphMapWidget.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp index 010913ee81..408e587f22 100644 --- a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp +++ b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp @@ -167,12 +167,8 @@ void GlyphMapWidget::mousedown_event(MouseEvent& event) auto glyph = maybe_glyph.value(); if (event.shift()) m_selection.extend_to(glyph); - else { - m_selection.set_size(1); - m_selection.set_start(glyph); - } m_in_drag_select = true; - set_active_glyph(glyph, ShouldResetSelection::No); + set_active_glyph(glyph, event.shift() ? ShouldResetSelection::No : ShouldResetSelection::Yes); } }