diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 64b2113ebf..37041f5d1d 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1871,7 +1871,10 @@ void wxGrid::Render( wxDC& dc, dc.DrawRectangle( pointOffSet, sizeCells ); // draw cells - DrawGridCellArea( dc, renderCells ); + { + wxDCClipper clipper( dc, wxRect(pointOffSet, sizeCells) ); + DrawGridCellArea( dc, renderCells ); + } // draw grid lines if ( style & wxGRID_DRAW_CELL_LINES ) diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 36ff071777..ecd8ac5d13 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -630,8 +630,7 @@ void wxGridCellStringRenderer::Draw(wxGrid& grid, for (int i = col + cell_cols; i <= col_end; i++) { clip.width = grid.GetColSize(i) - 1; - dc.DestroyClippingRegion(); - dc.SetClippingRegion(clip); + wxDCClipper clipper(dc, clip); SetTextColoursAndFont(grid, attr, dc, grid.IsInSelection(row,i)); @@ -644,7 +643,6 @@ void wxGridCellStringRenderer::Draw(wxGrid& grid, rect = rectCell; rect.Inflate(-1); rect.width++; - dc.DestroyClippingRegion(); } }