use virtual size for the size of the buffer when wxBUFFER_VIRTUAL_AREA style is used [backport from HEAD]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -173,7 +173,7 @@ public:
|
|||||||
if( buffer.IsOk() )
|
if( buffer.IsOk() )
|
||||||
Init(&m_paintdc, buffer, style);
|
Init(&m_paintdc, buffer, style);
|
||||||
else
|
else
|
||||||
Init(&m_paintdc, window->GetClientSize(), style);
|
Init(&m_paintdc, GetBufferedSize(window, style), style);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no bitmap is supplied by the user, a temporary one will be created.
|
// If no bitmap is supplied by the user, a temporary one will be created.
|
||||||
@@ -184,7 +184,7 @@ public:
|
|||||||
if (style & wxBUFFER_VIRTUAL_AREA)
|
if (style & wxBUFFER_VIRTUAL_AREA)
|
||||||
window->PrepareDC( m_paintdc );
|
window->PrepareDC( m_paintdc );
|
||||||
|
|
||||||
Init(&m_paintdc, window->GetClientSize(), style);
|
Init(&m_paintdc, GetBufferedSize(window, style), style);
|
||||||
}
|
}
|
||||||
|
|
||||||
// default copy ctor ok.
|
// default copy ctor ok.
|
||||||
@@ -196,6 +196,15 @@ public:
|
|||||||
UnMask();
|
UnMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// return the size needed by the buffer: this depends on whether we're
|
||||||
|
// buffering just the currently shown part or the total (scrolled) window
|
||||||
|
static wxSize GetBufferedSize(wxWindow *window, int style)
|
||||||
|
{
|
||||||
|
return style & wxBUFFER_VIRTUAL_AREA ? window->GetVirtualSize()
|
||||||
|
: window->GetClientSize();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxPaintDC m_paintdc;
|
wxPaintDC m_paintdc;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user