mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibGfx+Userland: Add width_rounded_up() helper
This commit is contained in:
parent
c9404c3a63
commit
55423b4ed0
Notes:
sideshowbarker
2024-07-17 11:33:34 +09:00
Author: https://github.com/thankyouverycool
Commit: 55423b4ed0
Pull-request: https://github.com/SerenityOS/serenity/pull/18372
21 changed files with 34 additions and 19 deletions
|
@ -43,7 +43,7 @@ void GroupBox::paint_event(PaintEvent& event)
|
|||
Gfx::StylePainter::paint_frame(painter, frame_rect, palette(), Gfx::FrameShape::Box, Gfx::FrameShadow::Sunken, 2);
|
||||
|
||||
if (!m_title.is_empty()) {
|
||||
Gfx::IntRect text_rect { 6, 1, static_cast<int>(ceilf(font().width(m_title) + 6)), font().pixel_size_rounded_up() };
|
||||
Gfx::IntRect text_rect { 6, 1, font().width_rounded_up(m_title) + 6, font().pixel_size_rounded_up() };
|
||||
painter.fill_rect(text_rect, palette().button());
|
||||
painter.draw_text(text_rect, m_title, Gfx::TextAlignment::CenterLeft, palette().button_text());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue