mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-18 01:19:45 +08:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user