summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/TableView.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-23 21:53:34 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-24 21:02:02 +0100
commitecc8e99a6bb71edecbb35769b01292945872dcf6 (patch)
tree8671a935f10443dd581dfbd7bae194c20a813255 /Userland/Libraries/LibGUI/TableView.cpp
parent6a6f19a72fe15c05c39a53fa5be2b4ca3d65edf3 (diff)
downloadserenity-ecc8e99a6bb71edecbb35769b01292945872dcf6.zip
LibGUI: Account for the row and column headers when painting a TableView
Otherwise we'd be drawing all the rows, instead of the ones in view. Fixes #5483.
Diffstat (limited to 'Userland/Libraries/LibGUI/TableView.cpp')
-rw-r--r--Userland/Libraries/LibGUI/TableView.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/TableView.cpp b/Userland/Libraries/LibGUI/TableView.cpp
index af3bba352f..2f48f466b9 100644
--- a/Userland/Libraries/LibGUI/TableView.cpp
+++ b/Userland/Libraries/LibGUI/TableView.cpp
@@ -73,8 +73,8 @@ void TableView::paint_event(PaintEvent& event)
int y_offset = column_header().is_visible() ? column_header().height() : 0;
bool dummy;
- int first_visible_row = index_at_event_position(frame_inner_rect().top_left(), dummy).row();
- int last_visible_row = index_at_event_position(frame_inner_rect().bottom_right(), dummy).row();
+ int first_visible_row = index_at_event_position(frame_inner_rect().top_left().translated(x_offset, y_offset), dummy).row();
+ int last_visible_row = index_at_event_position(frame_inner_rect().bottom_right().translated(x_offset, y_offset), dummy).row();
if (first_visible_row == -1)
first_visible_row = 0;