1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

Userland: Use Font::pixel_size_rounded_up() in more places

This commit is contained in:
Andreas Kling 2023-03-03 19:38:05 +01:00
parent 2e2c717e89
commit 508fb7e1e9
7 changed files with 10 additions and 10 deletions

View file

@ -66,8 +66,8 @@ void CheckBox::paint_event(PaintEvent& event)
if (m_checkbox_position == CheckBoxPosition::Left)
text_rect.set_left(box_rect.right() + 1 + gap_between_box_and_rect());
text_rect.set_width(static_cast<int>(ceilf(font().width(text()))));
text_rect.set_top(height() / 2 - static_cast<int>(ceilf(font().pixel_size()) / 2));
text_rect.set_height(static_cast<int>(ceilf(font().pixel_size())));
text_rect.set_top(height() / 2 - font().pixel_size_rounded_up() / 2);
text_rect.set_height(font().pixel_size_rounded_up());
if (fill_with_background_color())
painter.fill_rect(rect(), palette().window());