Add optional debugging for calls to ValueNode_*::operator(). export SYNFIG_DEBUG_VAL...
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_blinecalcwidth.cpp
index 1e50ae9..4d8ee0e 100644 (file)
@@ -86,14 +86,16 @@ ValueNode_BLineCalcWidth::~ValueNode_BLineCalcWidth()
 }
 
 ValueBase
-ValueNode_BLineCalcWidth::operator()(Time t)const
+ValueNode_BLineCalcWidth::operator()(Time t, Real amount)const
 {
-       const std::vector<ValueBase> bline((*bline_)(t));
+       if (getenv("SYNFIG_DEBUG_VALUENODE_OPERATORS"))
+               printf("%s:%d operator()\n", __FILE__, __LINE__);
+
+       const std::vector<ValueBase> bline((*bline_)(t).get_list());
        handle<ValueNode_BLine> bline_value_node(bline_);
        const bool looped(bline_value_node->get_loop());
        int size = bline.size(), from_vertex;
        bool loop((*loop_)(t).get(bool()));
-       Real amount((*amount_)(t).get(Real()));
        Real scale((*scale_)(t).get(Real()));
        BLinePoint blinepoint0, blinepoint1;
 
@@ -125,6 +127,13 @@ ValueNode_BLineCalcWidth::operator()(Time t)const
        return Real((width0 + (amount-from_vertex) * (width1-width0)) * scale);
 }
 
+ValueBase
+ValueNode_BLineCalcWidth::operator()(Time t)const
+{
+       Real amount((*amount_)(t).get(Real()));
+       return (*this)(t, amount);
+}
+
 String
 ValueNode_BLineCalcWidth::get_name()const
 {