1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 09:24:57 +00:00

LibGUI: Fix HeaderView::section_rect() for vertical headers

Vertical headers shouldn't worry about horizontal padding.
This commit is contained in:
Andreas Kling 2020-08-26 14:15:37 +02:00
parent c241ab75cd
commit 5b46835a9d

View file

@ -91,7 +91,9 @@ Gfx::IntRect HeaderView::section_rect(int section) const
for (int i = 0; i < section; ++i) {
if (!is_section_visible(i))
continue;
offset += section_data(i).size + horizontal_padding() * 2;
offset += section_data(i).size;
if (orientation() == Gfx::Orientation::Horizontal)
offset += horizontal_padding() * 2;
}
if (orientation() == Gfx::Orientation::Horizontal)
return { offset, 0, section_size(section) + horizontal_padding() * 2, height() };