Uncomment and fix Layer::simple_clone() to clone a layer without cloning all its...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 22 Nov 2008 15:36:25 +0000 (15:36 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 22 Nov 2008 15:36:25 +0000 (15:36 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2242 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/layer.cpp
synfig-core/trunk/src/synfig/layer.h

index 9a5bf2c..7643883 100644 (file)
@@ -304,18 +304,20 @@ Layer::get_z_depth(const synfig::Time& t)const
        return (*dynamic_param_list().find("z_depth")->second)(t).get(Real());
 }
 
-#ifdef THIS_CODE_IS_NOT_USED
-Layer*
+Layer::Handle
 Layer::simple_clone()const
 {
        if(!book().count(get_name())) return 0;
-       Layer *ret = create(get_name()).get();
-       ret->set_canvas(get_canvas());
+       Handle ret = create(get_name()).get();
+       ret->group_=group_;
+       //ret->set_canvas(get_canvas());
        ret->set_description(get_description());
+       ret->set_active(active());
        ret->set_param_list(get_param_list());
+       for(DynamicParamList::const_iterator iter=dynamic_param_list().begin();iter!=dynamic_param_list().end();++iter)
+               ret->connect_dynamic_param(iter->first, iter->second);
        return ret;
 }
-#endif /* THIS_CODE_IS_NOT_USED */
 
 Layer::Handle
 Layer::clone(const GUID& deriv_guid) const
index 12ae785..f729c40 100644 (file)
@@ -482,10 +482,8 @@ public:
        **  context until the final blend operation. */
        virtual bool reads_context()const;
 
-#ifdef THIS_CODE_IS_NOT_USED
        //! Duplicates the Layer without duplicating the value nodes
-       virtual Layer *simple_clone()const;
-#endif /* THIS_CODE_IS_NOT_USED */
+       virtual Handle simple_clone()const;
 
 protected: