X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/963f64fb949652fb0de2522d7422a412c102dab8..cd15bcaf50ead53ccf9d50965312f0dc754affb4:/samples/erase/erase.cpp diff --git a/samples/erase/erase.cpp b/samples/erase/erase.cpp index 307f639df9..37fc81bb88 100644 --- a/samples/erase/erase.cpp +++ b/samples/erase/erase.cpp @@ -362,6 +362,8 @@ MyCanvas::MyCanvas(wxFrame *parent) void MyCanvas::DoPaint(wxDC& dc) { + PrepareDC(dc); + if ( m_eraseBgInPaint ) { dc.SetBackground(*wxLIGHT_GREY); @@ -391,15 +393,11 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) if ( m_useBuffer ) { wxAutoBufferedPaintDC dc(this); - PrepareDC(dc); - DoPaint(dc); } else { wxPaintDC dc(this); - PrepareDC(dc); - DoPaint(dc); } }