From: Vadim Zeitlin Date: Mon, 21 Jan 2013 16:37:09 +0000 (+0000) Subject: Fix background drawing in EVT_ERASE_BACKGROUND handler in erase sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/99f22294f53e419f6b31abdbb744f6f7a5959e08?ds=sidebyside Fix background drawing in EVT_ERASE_BACKGROUND handler in erase sample. Clear the DC before moving its offset to ensure that it's cleared entirely and also draw the background using the virtual, not client, size. See #14917. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/erase/erase.cpp b/samples/erase/erase.cpp index eb54c2ede3..96e21c3b6f 100644 --- a/samples/erase/erase.cpp +++ b/samples/erase/erase.cpp @@ -419,12 +419,12 @@ void MyCanvas::OnEraseBackground( wxEraseEvent& event ) wxDC& dc = *event.GetDC(); dc.SetPen(*wxGREEN_PEN); - PrepareDC( dc ); - // clear any junk currently displayed dc.Clear(); - const wxSize size = GetClientSize(); + PrepareDC( dc ); + + const wxSize size = GetVirtualSize(); for ( int x = 0; x < size.x; x += 15 ) { dc.DrawLine(x, 0, x, size.y);