From: Stefan Csomor Date: Fri, 22 Apr 2005 06:53:03 +0000 (+0000) Subject: fix for drawing correct gridlines even on scrolled positions (wxMac) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c03bf0c7409638856e9f09624b16ecd6620d7eb9 fix for drawing correct gridlines even on scrolled positions (wxMac) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index e6ca7a0857..e3169c5357 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -7146,8 +7146,10 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) int topRow = internalYToRow(top); int rightCol = internalXToCol(right); int bottomRow = internalYToRow(bottom); - wxRegion clippedcells(0, 0, cw, ch); +#ifndef __WXMAC__ + // CS: I don't know why suddenly unscrolled coordinates are used for clipping + wxRegion clippedcells(0, 0, cw, ch); int i, j, cell_rows, cell_cols; wxRect rect; @@ -7171,6 +7173,30 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) } } } +#else + wxRegion clippedcells( left , top, right - left, bottom - top); + + int i, j, cell_rows, cell_cols; + wxRect rect; + + for (j=topRow; j 1) || (cell_cols > 1)) + { + rect = CellToRect(j,i); + clippedcells.Subtract(rect); + } + else if ((cell_rows < 0) || (cell_cols < 0)) + { + rect = CellToRect(j+cell_rows, i+cell_cols); + clippedcells.Subtract(rect); + } + } + } +#endif dc.SetClippingRegion( clippedcells ); dc.SetPen( wxPen(GetGridLineColour(), 1, wxSOLID) );