Revision: 2200
          http://synfig.svn.sourceforge.net/synfig/?rev=2200&view=rev
Author:   dooglus
Date:     2008-11-14 17:52:30 +0000 (Fri, 14 Nov 2008)

Log Message:
-----------
Fix 2116947: "Pasting/importing across different image areas".  When pasting 
nested pastecanvases, update the renddesc of all of them rather than just the 
outermost one.

Modified Paths:
--------------
    synfig-core/trunk/src/synfig/layer_pastecanvas.cpp
    synfig-core/trunk/src/synfig/layer_pastecanvas.h
    synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp

Modified: synfig-core/trunk/src/synfig/layer_pastecanvas.cpp
===================================================================
--- synfig-core/trunk/src/synfig/layer_pastecanvas.cpp  2008-11-14 17:51:42 UTC 
(rev 2199)
+++ synfig-core/trunk/src/synfig/layer_pastecanvas.cpp  2008-11-14 17:52:30 UTC 
(rev 2200)
@@ -241,6 +241,24 @@
                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()

Modified: synfig-core/trunk/src/synfig/layer_pastecanvas.h
===================================================================
--- synfig-core/trunk/src/synfig/layer_pastecanvas.h    2008-11-14 17:51:42 UTC 
(rev 2199)
+++ synfig-core/trunk/src/synfig/layer_pastecanvas.h    2008-11-14 17:52:30 UTC 
(rev 2200)
@@ -99,6 +99,8 @@
        bool extra_reference;
 public:
 
+       void update_renddesc();
+
        virtual void on_canvas_set();
 
        void set_muck_with_time(bool x=false) { muck_with_time_=x; }

Modified: synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp
===================================================================
--- synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp        2008-11-14 
17:51:42 UTC (rev 2199)
+++ synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp        2008-11-14 
17:52:30 UTC (rev 2200)
@@ -33,6 +33,7 @@
 #include "layeractionmanager.h"
 #include "layertree.h"
 #include <synfig/context.h>
+#include <synfig/layer_pastecanvas.h>
 #include <synfigapp/action_param.h>
 #include "instance.h"
 #include <synfigapp/selectionmanager.h>
@@ -400,6 +401,9 @@
                        return;
                }
 
+               etl::handle<Layer_PasteCanvas> paste = 
etl::handle<Layer_PasteCanvas>::cast_dynamic(layer);
+               if (paste) paste->update_renddesc();
+
                // synfig::info("DEPTH=%d",depth);
 
                // Action to move the layer (if necessary)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to