From: dooglus Date: Sat, 5 Jan 2008 22:45:52 +0000 (+0000) Subject: When we create a 'Duplicate' layer, automatically have its parameter already converte... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=03f9d7a946e2d2465f263349b2d6c60dd426d036;p=synfig.git When we create a 'Duplicate' layer, automatically have its parameter already converted to 'Duplicate' as well. git-svn-id: http://svn.voria.com/code@1268 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/layer_duplicate.cpp b/synfig-core/trunk/src/synfig/layer_duplicate.cpp index 69313d6..202a754 100644 --- a/synfig-core/trunk/src/synfig/layer_duplicate.cpp +++ b/synfig-core/trunk/src/synfig/layer_duplicate.cpp @@ -63,6 +63,8 @@ SYNFIG_LAYER_SET_CVS_ID(Layer_Duplicate,"$Id$"); Layer_Duplicate::Layer_Duplicate(): Layer_Composite(1.0,Color::BLEND_COMPOSITE) { + LinkableValueNode* index_value_node = ValueNode_Duplicate::create(int(3)); + connect_dynamic_param("index", index_value_node); } bool diff --git a/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp b/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp index 4c6ce2a..61ca9ec 100644 --- a/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp @@ -55,18 +55,19 @@ ValueNode_Duplicate::ValueNode_Duplicate(const ValueBase::Type &x): { } -ValueNode_Duplicate::ValueNode_Duplicate(const ValueNode::Handle &x): - LinkableValueNode(x->get_type()) +ValueNode_Duplicate::ValueNode_Duplicate(const ValueBase &x): + LinkableValueNode(x.get_type()) { - set_link("from", ValueNode_Const::create(int(0))); - set_link("to", ValueNode_Const::create(int(3))); + set_link("from", ValueNode_Const::create(int(1))); + set_link("to", ValueNode_Const::create(x.get(int()))); set_link("step", ValueNode_Const::create(int(1))); + index = 1; } ValueNode_Duplicate* ValueNode_Duplicate::create(const ValueBase &x) { - return new ValueNode_Duplicate(ValueNode_Const::create(x)); + return new ValueNode_Duplicate(x); } LinkableValueNode* diff --git a/synfig-core/trunk/src/synfig/valuenode_duplicate.h b/synfig-core/trunk/src/synfig/valuenode_duplicate.h index ef663d1..5dc8693 100644 --- a/synfig-core/trunk/src/synfig/valuenode_duplicate.h +++ b/synfig-core/trunk/src/synfig/valuenode_duplicate.h @@ -48,7 +48,7 @@ public: typedef etl::handle ConstHandle; ValueNode_Duplicate(const ValueBase::Type &x); - ValueNode_Duplicate(const ValueNode::Handle &x); + ValueNode_Duplicate(const ValueBase &x); virtual ValueBase operator()(Time t)const; void reset_index(Time t)const;