]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/dc.cpp
getting the wxWindow* on GTK
[wxWidgets.git] / src / dfb / dc.cpp
index 5c44c092d43bb08cac79c2228c02cc9eca7a5f2e..4e171feb3d47fbc41ea6e2d4e0c146c5a7439e7a 100644 (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);