diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2023-04-14 08:52:47 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-15 15:24:50 +0200 |
commit | 55423b4ed06b4db1b61f862250d17f3407671117 (patch) | |
tree | 9ebb7bae0360b068af9857100a6d90ee2272eec9 /Userland/Applications/KeyboardMapper | |
parent | c9404c3a63850719d79837a5c888382760b5d620 (diff) | |
download | serenity-55423b4ed06b4db1b61f862250d17f3407671117.zip |
LibGfx+Userland: Add width_rounded_up() helper
Diffstat (limited to 'Userland/Applications/KeyboardMapper')
-rw-r--r-- | Userland/Applications/KeyboardMapper/KeyButton.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/KeyboardMapper/KeyButton.cpp b/Userland/Applications/KeyboardMapper/KeyButton.cpp index c7d7f74e72..075fb35836 100644 --- a/Userland/Applications/KeyboardMapper/KeyButton.cpp +++ b/Userland/Applications/KeyboardMapper/KeyButton.cpp @@ -41,7 +41,7 @@ void KeyButton::paint_event(GUI::PaintEvent& event) if (text().is_empty() || text().bytes_as_string_view().starts_with('\0')) return; - Gfx::IntRect text_rect { 0, 0, static_cast<int>(ceilf(font.width(text()))), font.pixel_size_rounded_up() }; + Gfx::IntRect text_rect { 0, 0, font.width_rounded_up(text()), font.pixel_size_rounded_up() }; text_rect.align_within(key_cap_face_rect, Gfx::TextAlignment::Center); painter.draw_text(text_rect, text(), font, Gfx::TextAlignment::Center, Color::Black, Gfx::TextElision::Right); |