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
This commit is contained in:
Vadim Zeitlin
2013-02-10 16:13:58 +00:00
parent 963f64fb94
commit 2aee45f63a

View 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);
}
}