don't assert in wxDC::Blit() calls if the source rect is outside of source DC (wxCaret is prone to this)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2006-09-30 10:00:57 +00:00
parent 399754a683
commit 21e3246c42

View File

@@ -757,6 +757,16 @@ bool wxDC::DoBlitFromSurface(const wxIDirectFBSurfacePtr& src,
wxCoord w, wxCoord h,
wxCoord dstx, wxCoord dsty)
{
// don't do anything if the source rectangle is outside of source surface,
// DirectFB would assert in that case:
wxSize srcsize;
src->GetSize(&srcsize.x, &srcsize.y);
if ( !wxRect(srcx, srcy, w, h).Intersects(wxRect(srcsize)) )
{
wxLogDebug(_T("Blitting from area outside of the source surface, caller code needs fixing."));
return false;
}
CalcBoundingBox(dstx, dsty);
CalcBoundingBox(dstx + w, dsty + h);