Adjust scrolled contents only for wxPaintDC (drawing sample)
Adjust scrolled contents for screen drawing directly in EVT_PAINT handler instead of doing so conditionally for generic wxDC. This also helps demonstrating if wxPaintDC transformations are transferred properly to wxGCDC.
This commit is contained in:
parent
1baecca49a
commit
48d226bb84
1 changed files with 2 additions and 7 deletions
|
|
@ -1843,11 +1843,13 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
|
|||
if ( m_useBuffer )
|
||||
{
|
||||
wxBufferedPaintDC bpdc(this);
|
||||
PrepareDC(bpdc); // Adjust scrolled contents.
|
||||
Draw(bpdc);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxPaintDC pdc(this);
|
||||
PrepareDC(pdc); // Adjust scrolled contents.
|
||||
Draw(pdc);
|
||||
}
|
||||
}
|
||||
|
|
@ -1891,13 +1893,6 @@ void MyCanvas::Draw(wxDC& pdc)
|
|||
wxDC &dc = pdc ;
|
||||
#endif
|
||||
|
||||
// Adjust scrolled contents for screen drawing operations only.
|
||||
if ( wxDynamicCast(&pdc, wxBufferedPaintDC) ||
|
||||
wxDynamicCast(&pdc, wxPaintDC) )
|
||||
{
|
||||
PrepareDC(dc);
|
||||
}
|
||||
|
||||
m_owner->PrepareDC(dc);
|
||||
|
||||
dc.SetBackgroundMode( m_owner->m_backgroundMode );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue