X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/125817d0e302ec5f4a3ae0186ac97c477a35455e..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/common/dcbufcmn.cpp diff --git a/src/common/dcbufcmn.cpp b/src/common/dcbufcmn.cpp index b38b4f1f67..8c6c25b40e 100644 --- a/src/common/dcbufcmn.cpp +++ b/src/common/dcbufcmn.cpp @@ -34,6 +34,9 @@ // implementation // ============================================================================ +IMPLEMENT_DYNAMIC_CLASS(wxBufferedDC,wxMemoryDC) +IMPLEMENT_ABSTRACT_CLASS(wxBufferedPaintDC,wxBufferedDC) + // ---------------------------------------------------------------------------- // wxSharedDCBufferManager: helper class maintaining backing store bitmap // ---------------------------------------------------------------------------- @@ -56,6 +59,14 @@ public: h > ms_buffer->GetHeight() ) { delete ms_buffer; + + // we must always return a valid bitmap but creating a bitmap of + // size 0 would fail, so create a 1*1 bitmap in this case + if ( !w ) + w = 1; + if ( !h ) + h = 1; + ms_buffer = new wxBitmap(w, h); }