LibGUI: Improve visible glyph estimate in GlyphMapWidget

Previously the widget used a very rough estimate for visible glyphs
based on viewport and glyph areas. Now it simply figures rows times
columns with a two row overdraw to accommodate fractional glyphs
on either end of visible content. For KaticaRegular10, this ends up
reducing unnecessary glyph iterations during painting by about 30%.
This commit is contained in:
thankyouverycool 2022-12-15 17:16:36 -05:00 committed by Andreas Kling
commit a98d5c52f8
Notes: sideshowbarker 2024-07-17 07:25:39 +09:00
2 changed files with 10 additions and 6 deletions

View file

@ -100,6 +100,7 @@ private:
int m_glyph_count { 0x110000 };
int m_columns { 0 };
int m_rows { 0 };
int m_visible_rows { 0 };
int m_horizontal_spacing { 4 };
int m_vertical_spacing { 4 };
Selection m_selection;