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

Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()

The only remaining clients of this API are specific to bitmap fonts and
editing thereof.
This commit is contained in:
Andreas Kling 2023-03-03 19:32:19 +01:00
parent 93c9344e35
commit b71c7a6e44
32 changed files with 63 additions and 65 deletions

View file

@ -502,10 +502,9 @@ void BrickGame::paint_text(GUI::Painter& painter, int row, DeprecatedString cons
auto const text_width = static_cast<int>(ceilf(font().width(text)));
auto const entire_area_rect { frame_inner_rect() };
auto const margin = 4;
auto const glyph_height = font().glyph_height();
auto const rect { Gfx::IntRect { entire_area_rect.x() + entire_area_rect.width() - 116,
2 * margin + entire_area_rect.y() + (glyph_height + margin) * row,
text_width, glyph_height } };
2 * margin + entire_area_rect.y() + (font().pixel_size_rounded_up() + margin) * row,
text_width, font().pixel_size_rounded_up() } };
painter.draw_text(rect, text, Gfx::TextAlignment::TopLeft, Color::Black);
}