Fix 1993098: "Composited Inline canvases fails if background is transp.". This was...
[synfig.git] / synfig-core / trunk / src / synfig / layer_pastecanvas.cpp
index e456a03..bcf954f 100644 (file)
@@ -241,6 +241,24 @@ Layer_PasteCanvas::set_sub_canvas(etl::handle<synfig::Canvas> x)
                on_canvas_set();
 }
 
+// when a pastecanvas that contains another pastecanvas is copy/pasted
+// from one document to another, only the outermost pastecanvas was
+// getting its renddesc set to match that of its new parent.  this
+// function is used to recurse through the pastecanvas copying its
+// renddesc to any pastecanvases it contains (bug #2116947, svn r2200)
+void
+Layer_PasteCanvas::update_renddesc()
+{
+       if(!get_canvas() || !canvas || !canvas->is_inline()) return;
+
+       canvas->rend_desc()=get_canvas()->rend_desc();
+       for (Context context = canvas->get_context(); !context->empty(); context++)
+       {
+               etl::handle<Layer_PasteCanvas> paste = etl::handle<Layer_PasteCanvas>::cast_dynamic(*context);
+               if (paste) paste->update_renddesc();
+       }
+}
+
 // This is called whenever the parent canvas gets set/changed
 void
 Layer_PasteCanvas::on_canvas_set()
@@ -393,7 +411,7 @@ Layer_PasteCanvas::accelerated_render(Context context,Surface *surface,int quali
                if (blend_method==Color::BLEND_COMPOSITE) blend_using_straight = true;
        }
 
-       if (!etl::intersect(context.get_full_bounding_rect(),full_bounding_rect+origin))
+       if (!etl::intersect(context.get_full_bounding_rect(),(full_bounding_rect*exp(zoom))+origin))
        {
                // if there's no intersection between the context and our
                // surface, and we're rendering 'onto', then we're done