From: dooglus Date: Thu, 27 Sep 2007 20:51:29 +0000 (+0000) Subject: Allow the 'range' convert type to work with 'time' values too. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6c3dfccdf0d1fab1a47dc5f4b0351261f2287622;p=synfig.git Allow the 'range' convert type to work with 'time' values too. git-svn-id: http://svn.voria.com/code@777 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/valuenode_range.cpp b/synfig-core/trunk/src/synfig/valuenode_range.cpp index 9c2df59..21193d4 100644 --- a/synfig-core/trunk/src/synfig/valuenode_range.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_range.cpp @@ -75,6 +75,11 @@ synfig::ValueNode_Range::ValueNode_Range(const ValueBase &value): set_link("max",ValueNode_Const::create(value.get(Real()))); set_link("link",ValueNode_Const::create(value.get(Real()))); break; + case ValueBase::TYPE_TIME: + set_link("min",ValueNode_Const::create(value.get(Time()))); + set_link("max",ValueNode_Const::create(value.get(Time()))); + set_link("link",ValueNode_Const::create(value.get(Time()))); + break; default: assert(0); throw runtime_error("synfig::ValueNode_Range:Bad type "+ValueBase::type_name(id)); @@ -123,6 +128,8 @@ synfig::ValueNode_Range::operator()(Time t)const return range((*min_)(t).get(int()), (*max_)(t).get(int()), (*link_)(t).get(int())); case ValueBase::TYPE_REAL: return range((*min_)(t).get(Real()), (*max_)(t).get(Real()), (*link_)(t).get(Real())); + case ValueBase::TYPE_TIME: + return range((*min_)(t).get(Time()), (*max_)(t).get(Time()), (*link_)(t).get(Time())); default: assert(0); break; @@ -225,5 +232,6 @@ ValueNode_Range::check_type(ValueBase::Type type) { return type==ValueBase::TYPE_ANGLE || type==ValueBase::TYPE_INTEGER - || type==ValueBase::TYPE_REAL; + || type==ValueBase::TYPE_REAL + || type==ValueBase::TYPE_TIME; }