X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_subtract.cpp;h=27df6a04611f5e97e7f0168ba1f2e3a23810f293;hb=75a589f5db5821fc10dd67941e4ca587b32a69d0;hp=9d925f76a9fa550133a22f020291b0f374c3e031;hpb=2563a81f39d63a860d9bc459715e63afa75023db;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_subtract.cpp b/synfig-core/trunk/src/synfig/valuenode_subtract.cpp index 9d925f7..27df6a0 100644 --- a/synfig-core/trunk/src/synfig/valuenode_subtract.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_subtract.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -37,6 +38,7 @@ #include "vector.h" #include "angle.h" #include "real.h" +#include #endif @@ -172,11 +174,7 @@ synfig::ValueNode_Subtract::operator()(Time t)const case ValueBase::TYPE_COLOR: return ((*ref_a)(t).get(Color())-(*ref_b)(t).get(Color()))*(*scalar)(t).get(Real()); case ValueBase::TYPE_INTEGER: - { - Real ret = ((*ref_a)(t).get(int())-(*ref_b)(t).get(int()))*(*scalar)(t).get(Real()) + 0.5f; - if (ret < 0) return static_cast(ret-1); - return static_cast(ret); - } + return round_to_int(((*ref_a)(t).get(int())-(*ref_b)(t).get(int()))*(*scalar)(t).get(Real())); case ValueBase::TYPE_REAL: return ((*ref_a)(t).get(Vector::value_type())-(*ref_b)(t).get(Vector::value_type()))*(*scalar)(t).get(Real()); case ValueBase::TYPE_TIME: @@ -259,7 +257,6 @@ ValueNode_Subtract::link_name(int i)const int ValueNode_Subtract::get_link_index_from_name(const String &name)const { - printf("%s:%d link_index_from_name\n", __FILE__, __LINE__); if(name=="lhs") return 0; if(name=="rhs") return 1; if(name=="scalar") return 2;