1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +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

@ -241,8 +241,12 @@ Glyph BitmapFont::glyph(u32 code_point) const
int BitmapFont::glyph_or_emoji_width(u32 code_point) const
{
if (code_point < m_glyph_count)
return glyph_width(code_point);
if (code_point < m_glyph_count) {
if (m_glyph_widths[code_point] > 0)
return glyph_width(code_point);
else
return glyph_width('?');
}
if (m_fixed_width)
return m_glyph_width;