Преглед на файлове

LibGUI: Disallow GlyphMapWidget selection sizes equal to zero

This is a bogus size as the map must always have at least 1 glyph
selected, and it was causing occasional desync between selection
contents and the focused glyph when manipulating selections with
the keyboard.
thankyouverycool преди 2 години
родител
ревизия
360e58a276
променени са 2 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 1
      Userland/Libraries/LibGUI/GlyphMapWidget.cpp
  2. 0 1
      Userland/Libraries/LibGUI/GlyphMapWidget.h

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

@@ -44,7 +44,7 @@ bool GlyphMapWidget::Selection::contains(int i) const
 void GlyphMapWidget::Selection::extend_to(int glyph)
 {
     m_size = glyph - m_start;
-    if (m_size > 0)
+    if (m_size >= 0)
         m_size++;
 }
 

+ 0 - 1
Userland/Libraries/LibGUI/GlyphMapWidget.h

@@ -58,7 +58,6 @@ public:
     void set_active_range(Unicode::CodePointRange);
     void set_active_glyph(int, ShouldResetSelection = ShouldResetSelection::Yes);
     void set_selection(int start, int size, Optional<u32> active_glyph = {});
-    void clear_selection() { m_selection.set_size(0); }
     void scroll_to_glyph(int);
     void update_glyph(int);