1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

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
parent b0955fd269
commit 2f7b6af87e
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);