]> git.saurik.com Git - wxWidgets.git/commitdiff
No changes, just factor out PrepareDC() call in the erase sample.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Feb 2013 16:13:58 +0000 (16:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Feb 2013 16:13:58 +0000 (16:13 +0000)
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

index 307f639df9cf1a425551c1cc727a2a3798b71a0b..37fc81bb8870ddcdf4a444b02bde67e89b951343 100644 (file)
@@ -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);
     }
 }