From: dooglus Date: Sat, 22 Nov 2008 15:36:25 +0000 (+0000) Subject: Uncomment and fix Layer::simple_clone() to clone a layer without cloning all its... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=47a979c060132d120dbc8160aa9ae2e8c9d900c0;p=synfig.git Uncomment and fix Layer::simple_clone() to clone a layer without cloning all its valuenodes. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2242 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/layer.cpp b/synfig-core/trunk/src/synfig/layer.cpp index 9a5bf2c..7643883 100644 --- a/synfig-core/trunk/src/synfig/layer.cpp +++ b/synfig-core/trunk/src/synfig/layer.cpp @@ -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 diff --git a/synfig-core/trunk/src/synfig/layer.h b/synfig-core/trunk/src/synfig/layer.h index 12ae785..f729c40 100644 --- a/synfig-core/trunk/src/synfig/layer.h +++ b/synfig-core/trunk/src/synfig/layer.h @@ -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: