X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/455bec652a67f86df6a6d5524ca7fed37ac7a098..4dd8339b2a1a269284096e6bbaa9b6646774650e:/src/common/dcbufcmn.cpp diff --git a/src/common/dcbufcmn.cpp b/src/common/dcbufcmn.cpp index 23055c2187..2a8314d43e 100644 --- a/src/common/dcbufcmn.cpp +++ b/src/common/dcbufcmn.cpp @@ -105,6 +105,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxSharedDCBufferManager, wxModule) void wxBufferedDC::UseBuffer(wxCoord w, wxCoord h) { + wxCHECK_RET( w >= -1 && h >= -1, "Invalid buffer size" ); + if ( !m_buffer || !m_buffer->IsOk() ) { if ( w == -1 || h == -1 ) @@ -130,6 +132,9 @@ void wxBufferedDC::UnMask() wxCoord x = 0, y = 0; + // Ensure the scale matches the device + SetUserScale(1.0, 1.0); + if ( m_style & wxBUFFER_CLIENT_AREA ) GetDeviceOrigin(&x, &y);