From 5b46835a9d5b425cfcaee4d7563d85e4e45a9d89 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 26 Aug 2020 14:15:37 +0200 Subject: [PATCH] LibGUI: Fix HeaderView::section_rect() for vertical headers Vertical headers shouldn't worry about horizontal padding. --- Libraries/LibGUI/HeaderView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/LibGUI/HeaderView.cpp b/Libraries/LibGUI/HeaderView.cpp index 98abf2fa8e9..a9ddca5581b 100644 --- a/Libraries/LibGUI/HeaderView.cpp +++ b/Libraries/LibGUI/HeaderView.cpp @@ -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() };