Skip to content

Commit

Permalink
LibGUI: Set vertical distance between icons relative to scroll value
Browse files Browse the repository at this point in the history
When calculating the vertical distance between icons, we should take
into account the value of the vertical scrollbar.

Fixes SerenityOS#4040
  • Loading branch information
AmusedNetwork authored and awesomekling committed Nov 11, 2020
1 parent dc9ddf8 commit de6483b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/LibGUI/IconView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void IconView::paint_event(PaintEvent& event)
auto font = font_for_index(item_data.index);

Gfx::IntRect text_rect = item_data.text_rect;
auto icon_translation = translation.y() - 12;
auto icon_translation = translation.y() + vertical_scrollbar().value() - 12;
text_rect.set_height(text_rect.height() > icon_translation ? icon_translation : text_rect.height());

painter.fill_rect(text_rect, background_color);
Expand Down

0 comments on commit de6483b

Please sign in to comment.