]> git.saurik.com Git - wxWidgets.git/commitdiff
Erase the column label background in wxGrid to avoid display artefacts.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 May 2010 13:17:30 +0000 (13:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 May 2010 13:17:30 +0000 (13:17 +0000)
Apparently the column label text is not always drawn correctly when double
buffering is used, so erase the background completely before drawing the text.

Unfortunately this might result in flicker but presumably correct display is
more important.

Closes #12055.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index d0675c4d8a2215fc8821925136a9c8fee5c0b222..7ca5c3cdd97a6c075a8c83faa039a9bbc6ab057b 100644 (file)
@@ -5572,6 +5572,11 @@ void wxGrid::DrawColLabel(wxDC& dc, int col)
     }
     else
     {
+        // It is reported that we need to erase the background to avoid display
+        // artefacts, see #12055.
+        wxDCBrushChanger setBrush(dc, m_colWindow->GetBackgroundColour());
+        dc.DrawRectangle(rect);
+
         rend.DrawBorder(*this, dc, rect);
     }