Erase the entire virtual area of the window in the erase sample.

Just clearing the DC is not enough when the window is scrolled, so clear the
entire virtual area. We should be able to optimize it by clearing just the
rectangle currently scrolled into view but this is at least correct, i.e.
doesn't result in corrupted display, even if it's suboptimal.

See #14917.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-02-10 16:13:53 +00:00
parent d7763d16d7
commit 963f64fb94

View File

@@ -365,7 +365,11 @@ void MyCanvas::DoPaint(wxDC& dc)
if ( m_eraseBgInPaint ) if ( m_eraseBgInPaint )
{ {
dc.SetBackground(*wxLIGHT_GREY); dc.SetBackground(*wxLIGHT_GREY);
dc.Clear();
// Erase the entire virtual area, not just the client area.
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(GetBackgroundColour());
dc.DrawRectangle(GetVirtualSize());
dc.DrawText("Background erased in OnPaint", 65, 110); dc.DrawText("Background erased in OnPaint", 65, 110);
} }