Jelajahi Sumber

LibGUI: Use nicer API for contrained positions in GlyphMapWidget

Forgot about this little guy. Functionally the same here, but more
robust if scrollbars change.
thankyouverycool 3 tahun lalu
induk
melakukan
4f7b37de9c
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      Userland/Libraries/LibGUI/GlyphMapWidget.cpp

+ 1 - 1
Userland/Libraries/LibGUI/GlyphMapWidget.cpp

@@ -180,7 +180,7 @@ void GlyphMapWidget::mouseup_event(GUI::MouseEvent& event)
 {
 {
     if (!m_in_drag_select)
     if (!m_in_drag_select)
         return;
         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()) {
     if (auto maybe_glyph = glyph_at_position(constrained); maybe_glyph.has_value()) {
         auto glyph = maybe_glyph.value();
         auto glyph = maybe_glyph.value();
         m_selection.extend_to(glyph);
         m_selection.extend_to(glyph);