From 696a18c7e7448f195171d0a50a1e4afe231b177d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 22 Jun 2007 10:11:47 +0000 Subject: [PATCH] Correct gridlines drawing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 27b1c3f0e9..efbfd62082 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2771,8 +2771,9 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxPen pen(GetRuleColour(), 1, wxSOLID); wxSize clientSize = GetClientSize(); - // Don't draw the first one - for ( size_t i = visibleFrom + 1; i <= visibleTo; i++ ) + size_t i = visibleFrom; + if (i == 0) i = 1; // Don't draw the first one + for ( ; i <= visibleTo; i++ ) { dc.SetPen(pen); dc.SetBrush( *wxTRANSPARENT_BRUSH ); @@ -2806,8 +2807,10 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) { int colWidth = GetColumnWidth(col); x += colWidth; - dc.DrawLine(x - dev_x - 2, firstItemRect.GetY() - 1 - dev_y, - x - dev_x - 2, lastItemRect.GetBottom() + 1 - dev_y); + int x_pos = x - dev_x; + if (col < GetColumnCount()-1) x_pos -= 2; + dc.DrawLine(x_pos, firstItemRect.GetY() - 1 - dev_y, + x_pos, lastItemRect.GetBottom() + 1 - dev_y); } } } -- 2.45.2