X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_add.cpp;h=bf9f949a9794d4ee802c681fd5bcfd7cfee43de7;hb=9bb17dbd43d0988caab3a1fa420aa52a32e4fdc5;hp=37b79a2b08a674099b0f97e36bbce16cde2eb674;hpb=241290ec883794d1579593182b337277f6ef5182;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_add.cpp b/synfig-core/trunk/src/synfig/valuenode_add.cpp index 37b79a2..bf9f949 100644 --- a/synfig-core/trunk/src/synfig/valuenode_add.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_add.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file valuenode_add.cpp -** \brief Template File +** \brief Implementation of the "Add" valuenode conversion. ** ** $Id$ ** ** \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_Add::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: