mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 01:37:44 +00:00
LibGfx+Userland: Add width_rounded_up() helper
This commit is contained in:
parent
c9404c3a63
commit
55423b4ed0
21 changed files with 34 additions and 19 deletions
|
@ -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 = static_cast<int>(ceilf(font.width(score_text)));
|
||||
auto score_text_width = font.width_rounded_up(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.pixel_size_rounded_up() / 2 },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue