From 963f64fb949652fb0de2522d7422a412c102dab8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Feb 2013 16:13:53 +0000 Subject: [PATCH] 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 --- samples/erase/erase.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/erase/erase.cpp b/samples/erase/erase.cpp index 96e21c3b6f..307f639df9 100644 --- a/samples/erase/erase.cpp +++ b/samples/erase/erase.cpp @@ -365,7 +365,11 @@ void MyCanvas::DoPaint(wxDC& dc) if ( m_eraseBgInPaint ) { 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); } -- 2.45.2