mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00: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
|
@ -272,7 +272,7 @@ void HeaderView::paint_horizontal(Painter& painter)
|
|||
painter.draw_text(text_rect, text, font(), section_data.alignment, palette().button_text());
|
||||
|
||||
if (is_key_column && (m_table_view.sort_order() != SortOrder::None)) {
|
||||
Gfx::IntPoint offset { text_rect.x() + static_cast<int>(ceilf(font().width(text))) + sorting_arrow_offset, sorting_arrow_offset };
|
||||
Gfx::IntPoint offset { text_rect.x() + font().width_rounded_up(text) + sorting_arrow_offset, sorting_arrow_offset };
|
||||
auto coordinates = m_table_view.sort_order() == SortOrder::Ascending
|
||||
? ascending_arrow_coordinates.span()
|
||||
: descending_arrow_coordinates.span();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue