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

LibWeb: Allow fractional font sizes in CSS

Fixes an issue where relative font sizes would "snap" to integer sizes
in an unpleasant-looking way while resizing on some websites.
This commit is contained in:
Andreas Kling 2023-09-15 15:29:31 +02:00
parent 4d71f4edc4
commit 23569f8690
3 changed files with 44 additions and 2 deletions

View file

@ -2051,8 +2051,7 @@ RefPtr<Gfx::Font const> StyleComputer::compute_font_for_style_values(DOM::Elemen
maybe_length = font_size.as_calculated().resolve_length(length_resolution_context);
}
if (maybe_length.has_value()) {
auto px = maybe_length.value().to_px(length_resolution_context).to_int();
font_size_in_px = px;
font_size_in_px = maybe_length.value().to_px(length_resolution_context);
}
}