X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_timestring.cpp;h=a0808aae2f80408b899b6eda044131e52924cb17;hb=1891afee8b0ad9e67c56b1c262a940a0bb5042cb;hp=019871684c8e2a8df94773481e11181bbef98c6a;hpb=b9a14d1642ddddb939a0f823ecd9089bb3e1fede;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_timestring.cpp b/synfig-core/trunk/src/synfig/valuenode_timestring.cpp index 0198716..a0808aa 100644 --- a/synfig-core/trunk/src/synfig/valuenode_timestring.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_timestring.cpp @@ -57,7 +57,7 @@ ValueNode_TimeString::ValueNode_TimeString(const ValueBase &value): switch(value.get_type()) { case ValueBase::TYPE_STRING: - set_link("time",ValueNode_Const::create(Time())); + set_link("time",ValueNode_Const::create(Time(0))); break; default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); @@ -86,12 +86,18 @@ ValueNode_TimeString::~ValueNode_TimeString() ValueBase ValueNode_TimeString::operator()(Time t)const { + if (getenv("SYNFIG_DEBUG_VALUENODE_OPERATORS")) + printf("%s:%d operator()\n", __FILE__, __LINE__); + Time time((*time_)(t).get(Time())); switch (get_type()) { case ValueBase::TYPE_STRING: - return time.get_string(get_parent_canvas()->rend_desc().get_frame_rate()); + if (get_root_canvas()) + return time.get_string(get_root_canvas()->rend_desc().get_frame_rate()); + else + return time.get_string(); default: break; }