mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibGfx: Make Gfx::FontMetrics include the advance of '0' instead of 'M'
CSS actually wants the advance of the ASCII '0' character for its "ch" units, so let's include that instead of the arbitrarily chosen 'M'.
This commit is contained in:
@@ -76,7 +76,7 @@ float Length::relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::Font
|
||||
return m_value * font_size;
|
||||
case Type::Ch:
|
||||
// FIXME: Use layout_node.font().glyph_height() when writing-mode is not horizontal-tb (it has to be implemented first)
|
||||
return m_value * (font_metrics.glyph_width + font_metrics.glyph_spacing);
|
||||
return m_value * (font_metrics.advance_of_ascii_zero + font_metrics.glyph_spacing);
|
||||
case Type::Rem:
|
||||
return m_value * root_font_size;
|
||||
case Type::Vw:
|
||||
|
||||
Reference in New Issue
Block a user