return ValueBase();
}
+synfig::ValueBase
+synfig::ValueNode_Scale::operator()(Time t, const synfig::Point &target_value)const
+{
+ Real scalar_value((*scalar)(t).get(Real()));
+ if(scalar_value==0)
+ return (*value_node)(t).get(value_node->get_type());
+ switch (get_type())
+ case ValueBase::TYPE_REAL:
+ return target_value.mag() / scalar_value;
+ case ValueBase::TYPE_ANGLE:
+ return Angle::tan(target_value[1] / scalar_value ,target_value[0] / scalar_value);
+ default:
+ return target_value / scalar_value;
+}
+
bool
ValueNode_Scale::set_link_vfunc(int i,ValueNode::Handle value)
virtual ValueBase operator()(Time t)const;
+ //! Returns the modified Link to match the target value at time t
+ virtual ValueBase operator()(Time t, const synfig::Point &target_value) const;
+
virtual String get_name()const;
virtual String get_local_name()const;
}
}
+ if (ValueNode_Scale::Handle scale_value_node = ValueNode_Scale::Handle::cast_dynamic(value_desc.get_value_node()))
+ {
+ int link_index(scale_value_node->get_link_index_from_name("link"));
+ return canvas_interface()->change_value(synfigapp::ValueDesc(scale_value_node,link_index), scale_value_node(t, value));
+ }
+
switch(value_desc.get_value_type())
{
case ValueBase::TYPE_REAL:
#include <synfig/valuenode_blinecalctangent.h>
#include <synfig/valuenode_blinecalcvertex.h>
#include <synfig/valuenode_blinecalcwidth.h>
+#include <synfig/valuenode_scale.h>
#include <map>
#include "general.h"
|| ValueNode_BLineCalcVertex::Handle::cast_dynamic(value_node)
|| ValueNode_BLineCalcTangent::Handle::cast_dynamic(value_node)
|| ValueNode_BLineCalcWidth::Handle::cast_dynamic(value_node)
+ || ValueNode_Scale::Handle::cast_dynamic(value_node)
)
return true;
return false;