]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for artefacts when dragging a column divider in wxListCtrl with wxLC_VRULES style...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Feb 2006 22:03:53 +0000 (22:03 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Feb 2006 22:03:53 +0000 (22:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 9721b5465181345727a196a9815b4b8d1204eb8a..6b9ef732a65bc86486e6abb9ecb3effffaa112b8 100644 (file)
@@ -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());
             }
         }
     }