From: Vadim Zeitlin Date: Fri, 21 May 2010 13:17:30 +0000 (+0000) Subject: Erase the column label background in wxGrid to avoid display artefacts. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b5e97a17b1afb7cea4c03def51e830b5cd6d92d6?ds=inline Erase the column label background in wxGrid to avoid display artefacts. 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 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index d0675c4d8a..7ca5c3cdd9 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -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); }