mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +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:
parent
0664fbd584
commit
cc7744f6ca
3 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue