From 62e220a8db350b588437ada59004749f895b384a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 3 Sep 2025 10:27:44 -0700 Subject: [PATCH] Reverse cell painting for Windows Apparently Windows might not respect painting with a transparent alpha, so reverse the paint order Fixes https://gitlab.com/kicad/code/kicad/-/issues/21635 --- include/widgets/grid_striped_renderer.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/include/widgets/grid_striped_renderer.h b/include/widgets/grid_striped_renderer.h index fd13ce7b9b..8a69bb3380 100644 --- a/include/widgets/grid_striped_renderer.h +++ b/include/widgets/grid_striped_renderer.h @@ -39,17 +39,12 @@ public: void Draw( wxGrid& grid, wxGridCellAttr& attr, wxDC& dc, const wxRect& rect, int row, int col, bool isSelected ) override { - // First draw the striped background for empty cells - wxString cellValue = grid.GetCellValue( row, col ); + // Draw the foreground content using the base renderer first + T::Draw( grid, attr, dc, rect, row, col, isSelected ); - if( cellValue.IsEmpty() ) - { + // Overlay striped background for empty cells + if( grid.GetCellValue( row, col ).IsEmpty() ) drawStripedBackground( dc, attr, rect, isSelected ); - attr.SetBackgroundColour( wxColour( 0, 0, 0, wxALPHA_TRANSPARENT ) ); - } - - // Then draw the foreground content using the base renderer - T::Draw( grid, attr, dc, rect, row, col, isSelected ); } wxGridCellRenderer* Clone() const override