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

LibWeb: Don't round font sizes when looking them up

We previously had a rounding error which sometimes led to asking LibGfx
for fonts with slightly wrong sizes.
This commit is contained in:
Andreas Kling 2022-03-26 23:55:11 +01:00
parent ee883372f6
commit d5bba91a16
2 changed files with 4 additions and 4 deletions

View file

@ -877,7 +877,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele
bool monospace = false;
auto find_font = [&](String const& family) -> RefPtr<Gfx::Font> {
int font_size_in_pt = roundf(font_size_in_px * 0.75f);
float font_size_in_pt = font_size_in_px * 0.75f;
font_selector = { family, font_size_in_pt, weight, slope };
if (auto found_font = FontCache::the().get(font_selector))