From 21e3246c42c29fe01d37597036e766a082e062ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 30 Sep 2006 10:00:57 +0000 Subject: [PATCH] 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 --- src/dfb/dc.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dfb/dc.cpp b/src/dfb/dc.cpp index 5c44c092d4..4e171feb3d 100644 --- a/src/dfb/dc.cpp +++ b/src/dfb/dc.cpp @@ -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); -- 2.50.0