From: dooglus Date: Tue, 18 Sep 2007 23:16:56 +0000 (+0000) Subject: Fix to allow the 'scale' valuenode be used with integers. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ed67b2cf8837fad1816498bc0ed403e8bd6252ca;p=synfig.git Fix to allow the 'scale' valuenode be used with integers. git-svn-id: http://svn.voria.com/code@718 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/valuenode_scale.cpp b/synfig-core/trunk/src/synfig/valuenode_scale.cpp index 7bd8d18..181cc29 100644 --- a/synfig-core/trunk/src/synfig/valuenode_scale.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_scale.cpp @@ -174,7 +174,11 @@ synfig::ValueNode_Scale::operator()(Time t)const return (*value_node)(t).get(Time())*(*scalar)(t).get(Time()); else if(get_type()==ValueBase::TYPE_INTEGER) - return (*value_node)(t).get(int())*(*scalar)(t).get(Real()); + { + Real ret = (*value_node)(t).get(int())*(*scalar)(t).get(Real()) + 0.5f; + if (ret < 0) return static_cast(ret-1); + return static_cast(ret); + } else if(get_type()==ValueBase::TYPE_ANGLE) return (*value_node)(t).get(Angle())*(*scalar)(t).get(Real());