mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:57:47 +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
|
@ -201,7 +201,7 @@ void CardPainter::paint_card_front(Gfx::Bitmap& bitmap, Cards::Suit suit, Cards:
|
|||
paint_rect.set_height(paint_rect.height() / 2);
|
||||
paint_rect.shrink(10, 6);
|
||||
|
||||
auto text_rect = Gfx::IntRect { 4, 6, static_cast<int>(ceilf(font.width("10"sv))), font.pixel_size_rounded_up() };
|
||||
auto text_rect = Gfx::IntRect { 4, 6, font.width_rounded_up("10"sv), font.pixel_size_rounded_up() };
|
||||
painter.draw_text(text_rect, card_rank_label(rank), font, Gfx::TextAlignment::Center, suit_color);
|
||||
|
||||
painter.draw_bitmap(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue