From: dooglus Date: Tue, 18 Sep 2007 19:25:56 +0000 (+0000) Subject: Fix a crash when converting an integer type to 'subtract'. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1f990bde7879dfa0f35a004478217066dcd9beba;p=synfig.git Fix a crash when converting an integer type to 'subtract'. git-svn-id: http://svn.voria.com/code@709 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/valuenode_subtract.cpp b/synfig-core/trunk/src/synfig/valuenode_subtract.cpp index a541edc..cb43e95 100644 --- a/synfig-core/trunk/src/synfig/valuenode_subtract.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_subtract.cpp @@ -197,7 +197,7 @@ synfig::ValueNode_Subtract::operator()(Time t)const if(get_type()==ValueBase::TYPE_COLOR) return ((*ref_a)(t).get(Color())-(*ref_b)(t).get(Color()))*(*scalar)(t).get(Real()); if(get_type()==ValueBase::TYPE_INTEGER) - return ((*ref_a)(t).get(int())-(*ref_b)(t).get(int()))*(*scalar)(t).get(Real()); + return static_cast(((*ref_a)(t).get(int())-(*ref_b)(t).get(int()))*(*scalar)(t).get(Real()) + 0.5f); if(get_type()==ValueBase::TYPE_REAL) return ((*ref_a)(t).get(Vector::value_type())-(*ref_b)(t).get(Vector::value_type()))*(*scalar)(t).get(Real()); if(get_type()==ValueBase::TYPE_VECTOR)