X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_scale.cpp;h=0afab2097a62a71ab9af43b21a2d3d1c880ddc7d;hb=6f8559ddcb82636029d07776700d51b0e0c35e92;hp=ae32f979852a281ed6fa74aa19bd75c648b63b6f;hpb=62999c94c88e5c867f88eb39fd8653680df0ad50;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_scale.cpp b/synfig-core/trunk/src/synfig/valuenode_scale.cpp index ae32f97..0afab20 100644 --- a/synfig-core/trunk/src/synfig/valuenode_scale.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_scale.cpp @@ -59,7 +59,7 @@ using namespace synfig; ValueNode_Scale::ValueNode_Scale(const ValueBase &value): LinkableValueNode(value.get_type()) { - set_scalar(1.0); + set_link("scalar",ValueNode::Handle(ValueNode_Const::create(Real(1.0)))); ValueBase::Type id(value.get_type()); switch(id) @@ -88,7 +88,7 @@ ValueNode_Scale::ValueNode_Scale(const ValueBase &value): } assert(value_node); - assert(get_value_node()->get_type()==id); + assert(value_node->get_type()==id); assert(get_type()==id); } @@ -109,56 +109,6 @@ synfig::ValueNode_Scale::~ValueNode_Scale() unlink_all(); } -void -ValueNode_Scale::set_scalar(Real x) -{ - set_link("scalar",ValueNode::Handle(ValueNode_Const::create(x))); -} - -bool -ValueNode_Scale::set_scalar(const ValueNode::Handle &x) -{ - if(!x - || x->get_type()!=ValueBase::TYPE_REAL - && !PlaceholderValueNode::Handle::cast_dynamic(x) - ) - return false; - scalar=x; - return true; -} - -ValueNode::Handle -ValueNode_Scale::get_scalar()const -{ - return scalar; -} - -bool -ValueNode_Scale::set_value_node(const ValueNode::Handle &x) -{ - assert(get_type()); - - // if this isn't a proper value - if(!x || - // or we don't have a type, and this value isn't one of the types we accept - (get_type()==ValueBase::TYPE_NIL && !check_type(x->get_type())) || - // or we have a type and this value is a different type and (placeholder?) - (get_type()!=ValueBase::TYPE_NIL && x->get_type()!=get_type() && !PlaceholderValueNode::Handle::cast_dynamic(x))) - // then fail to set the value - return false; - - value_node=x; - - return true; -} - -ValueNode::Handle -ValueNode_Scale::get_value_node()const -{ - return value_node; -} - - synfig::ValueBase synfig::ValueNode_Scale::operator()(Time t)const { @@ -190,19 +140,16 @@ synfig::ValueNode_Scale::operator()(Time t)const bool -ValueNode_Scale::set_link_vfunc(int i,ValueNode::Handle x) +ValueNode_Scale::set_link_vfunc(int i,ValueNode::Handle value) { assert(i>=0 && i