From 2f918abf3acc3319aab88ce1de5090e901172353 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 10:25:02 +0100 Subject: [PATCH] Clear empty space beyond the right edge of the grid See #18313. --- src/propgrid/propgrid.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 67ac880631..55a33034f9 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2165,7 +2165,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, wxPGProperty* nextP = visPropArray[0]; - int gridWidth = state->GetVirtualWidth(); + int gridWidth = itemsRect->x + itemsRect->width; // Calculate splitters positions wxVector splitterPos; @@ -2501,6 +2501,11 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, y += rowHeight; } + // Clear empty space beyond the right edge of the grid + dc.SetPen(wxPen(m_colEmptySpace)); + dc.SetBrush(wxBrush(m_colEmptySpace)); + dc.DrawRectangle(cellX, firstItemTopY, gridWidth - cellX, lastItemBottomY - firstItemTopY); + return y - 1 + vy; }