1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:37:35 +00:00

LibGfx+Userland: Add width_rounded_up() helper

This commit is contained in:
thankyouverycool 2023-04-14 08:52:47 -04:00 committed by Andreas Kling
parent c9404c3a63
commit 55423b4ed0
21 changed files with 34 additions and 19 deletions

View file

@ -81,7 +81,7 @@ void LinkLabel::paint_event(PaintEvent& event)
GUI::Painter painter(*this);
if (m_hovered)
painter.draw_line({ 0, rect().bottom() }, { static_cast<int>(ceilf(font().width(text()))), rect().bottom() }, palette().link());
painter.draw_line({ 0, rect().bottom() }, { font().width_rounded_up(text()), rect().bottom() }, palette().link());
if (is_focused())
painter.draw_focus_rect(text_rect(), palette().focus_outline());