1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibGfx+FontEditor: Account for raw width when painting glyphs

Fixes hidden glyphs being painted in editor and map, and '?'
subsitute glyphs being overdrawn in the system.
This commit is contained in:
thankyouverycool 2021-04-22 14:25:28 -04:00 committed by Andreas Kling
parent 0664fbd584
commit cc7744f6ca
3 changed files with 9 additions and 4 deletions

View file

@ -98,7 +98,8 @@ void GlyphMapWidget::paint_event(GUI::PaintEvent& event)
font().glyph_height());
if (glyph == m_selected_glyph) {
painter.fill_rect(outer_rect, is_focused() ? palette().selection() : palette().inactive_selection());
painter.draw_glyph(inner_rect.location(), glyph, is_focused() ? palette().selection_text() : palette().inactive_selection_text());
if (m_font->contains_glyph(glyph))
painter.draw_glyph(inner_rect.location(), glyph, is_focused() ? palette().selection_text() : palette().inactive_selection_text());
} else if (m_font->contains_glyph(glyph)) {
painter.fill_rect(outer_rect, palette().base());
painter.draw_glyph(inner_rect.location(), glyph, palette().base_text());