From 2aee45f63afa24557ffc9465ed9ea4df8e2c54a7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Feb 2013 16:13:58 +0000 Subject: [PATCH] No changes, just factor out PrepareDC() call in the erase sample. Call this only once in DoPaint() itself instead of calling it twice before calling it. See #14917. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/erase/erase.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); } } -- 2.47.2