From 9eaba6927648cf2989a3fddf4a5e2deea1d62708 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Feb 2006 22:03:53 +0000 Subject: [PATCH 1/1] fix for artefacts when dragging a column divider in wxListCtrl with wxLC_VRULES style (patch 1411857 closing bug 673394) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 9721b54651..6b9ef732a6 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2475,13 +2475,23 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) if (GetItemRect(i, itemRect)) { - int col; + // this is a fix for bug 673394: erase the pixels which we would + // otherwise leave on the screen + static const int gap = 2; + dc.SetPen(*wxTRANSPARENT_PEN); + dc.SetBrush(wxBrush(GetBackgroundColour())); + dc.DrawRectangle(0, firstItemRect.GetY() - gap, + clientSize.GetWidth(), gap); + + dc.SetPen(pen); + dc.SetBrush(*wxTRANSPARENT_BRUSH); int x = itemRect.GetX(); - for (col = 0; col < GetColumnCount(); col++) + for (int col = 0; col < GetColumnCount(); col++) { int colWidth = GetColumnWidth(col); x += colWidth ; - dc.DrawLine(x-1, firstItemRect.GetY() - 2, x-1, itemRect.GetBottom()); + dc.DrawLine(x-1, firstItemRect.GetY() - gap, + x-1, itemRect.GetBottom()); } } } -- 2.45.2