X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_add.cpp;h=366b325270efb57d7f74d70d67520ff3fc3600a5;hb=e4883f31d05090b5e55b1364503862fb493ed7d1;hp=d5cc0b067ad25f580e5a617d1ae5e14846f15460;hpb=6c27d1b6cf4694a873542cb264c650893f2c6e0e;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_add.cpp b/synfig-core/trunk/src/synfig/valuenode_add.cpp index d5cc0b0..366b325 100644 --- a/synfig-core/trunk/src/synfig/valuenode_add.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_add.cpp @@ -35,6 +35,7 @@ #include "valuenode_const.h" #include #include "color.h" +#include "gradient.h" #include "vector.h" #include "angle.h" #include "real.h" @@ -72,6 +73,10 @@ synfig::ValueNode_Add::ValueNode_Add(const ValueBase &value): set_link("lhs",ValueNode_Const::create(value.get(Color()))); set_link("rhs",ValueNode_Const::create(Color(0,0,0,0))); break; + case ValueBase::TYPE_GRADIENT: + set_link("lhs",ValueNode_Const::create(value.get(Gradient()))); + set_link("rhs",ValueNode_Const::create(Gradient())); + break; case ValueBase::TYPE_INTEGER: set_link("lhs",ValueNode_Const::create(value.get(int()))); set_link("rhs",ValueNode_Const::create(int(0))); @@ -90,7 +95,7 @@ synfig::ValueNode_Add::ValueNode_Add(const ValueBase &value): break; default: assert(0); - throw runtime_error(_("synfig::ValueNode_Add:Bad type ")+ValueBase::type_local_name(id)); + throw runtime_error(get_local_name()+_(":Bad type ")+ValueBase::type_local_name(id)); } } @@ -122,6 +127,8 @@ synfig::ValueNode_Add::operator()(Time t)const return ((*ref_a)(t).get(Angle())+(*ref_b)(t).get(Angle()))*(*scalar)(t).get(Real()); case ValueBase::TYPE_COLOR: return ((*ref_a)(t).get(Color())+(*ref_b)(t).get(Color()))*(*scalar)(t).get(Real()); + case ValueBase::TYPE_GRADIENT: + return ((*ref_a)(t).get(Gradient())+(*ref_b)(t).get(Gradient()))*(*scalar)(t).get(Real()); case ValueBase::TYPE_INTEGER: return round_to_int(((*ref_a)(t).get(int())+(*ref_b)(t).get(int()))*(*scalar)(t).get(Real())); case ValueBase::TYPE_REAL: @@ -141,6 +148,7 @@ bool ValueNode_Add::set_link_vfunc(int i,ValueNode::Handle value) { assert(i>=0 && i=0 && i=0 && i=0 && i