LibGfx: Remove code point parameter from Gfx::Font::Metrics

Everyone was asking for the glyph width of 'M' anyway. We can just make
that request implicit and simplify the API.
This commit is contained in:
Andreas Kling 2022-03-28 11:57:44 +02:00
commit 2f7b6af87e
Notes: sideshowbarker 2024-07-17 22:41:14 +09:00
5 changed files with 9 additions and 9 deletions

View file

@ -166,7 +166,7 @@ bool MediaFeature::compare(HTML::Window const& window, MediaFeatureValue left, C
Gfx::IntRect viewport_rect { 0, 0, window.inner_width(), window.inner_height() };
auto const& initial_font = window.associated_document().style_computer().initial_font();
Gfx::FontMetrics const& initial_font_metrics = initial_font.metrics('M');
Gfx::FontMetrics const& initial_font_metrics = initial_font.metrics();
float initial_font_size = initial_font.presentation_size();
left_px = left.length().to_px(viewport_rect, initial_font_metrics, initial_font_size, initial_font_size);