From ed67b2cf8837fad1816498bc0ed403e8bd6252ca Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 18 Sep 2007 23:16:56 +0000 Subject: [PATCH] Fix to allow the 'scale' valuenode be used with integers. git-svn-id: http://svn.voria.com/code@718 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/valuenode_scale.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()); -- 2.7.4