From 4f7b37de9c2b03d00fd9ebcb12a7251e9bb42724 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Fri, 18 Mar 2022 11:12:16 -0400 Subject: [PATCH] LibGUI: Use nicer API for contrained positions in GlyphMapWidget Forgot about this little guy. Functionally the same here, but more robust if scrollbars change. --- Userland/Libraries/LibGUI/GlyphMapWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp index 9c0cbda189..010913ee81 100644 --- a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp +++ b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp @@ -180,7 +180,7 @@ void GlyphMapWidget::mouseup_event(GUI::MouseEvent& event) { if (!m_in_drag_select) return; - auto constrained = event.position().constrained(rect().shrunken(0, frame_thickness() * 2)); + auto constrained = event.position().constrained(widget_inner_rect()); if (auto maybe_glyph = glyph_at_position(constrained); maybe_glyph.has_value()) { auto glyph = maybe_glyph.value(); m_selection.extend_to(glyph);