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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user