1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:27:35 +00:00

LibWeb: Use Gfx::Font::pixel_size() when we want pixel metrics

This gives us consistent results with both bitmap and scalable fonts.
This commit is contained in:
Andreas Kling 2022-03-27 00:58:52 +01:00
parent 65629d26fe
commit b0208f38f6
3 changed files with 6 additions and 6 deletions

View file

@ -61,7 +61,7 @@ void ImageBox::prepare_for_replaced_layout()
if (alt.is_empty())
alt = image_element.src();
set_intrinsic_width(font.width(alt) + 16);
set_intrinsic_height(font.glyph_height() + 16);
set_intrinsic_height(font.pixel_size() + 16);
}
if (!has_intrinsic_width() && !has_intrinsic_height()) {