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

LibGfx: Make Font::width() return a float

This commit is contained in:
Andreas Kling 2023-01-03 14:43:07 +01:00
parent b9d2b8f7b2
commit 3407ab0fd1
25 changed files with 40 additions and 40 deletions

View file

@ -71,7 +71,7 @@ void ScoreCard::paint_event(GUI::PaintEvent& event)
for (int score_index = 0; score_index < (int)player.scores.size(); score_index++) {
auto text_rect = cell_rect(player_index, 1 + score_index);
auto score_text = DeprecatedString::formatted("{}", player.scores[score_index]);
auto score_text_width = font.width(score_text);
auto score_text_width = static_cast<int>(ceilf(font.width(score_text)));
if (score_index != (int)player.scores.size() - 1) {
painter.draw_line(
{ text_rect.left() + text_rect.width() / 2 - score_text_width / 2 - 3, text_rect.top() + font.glyph_height() / 2 },