X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_scale.cpp;h=ffe90d6459635c372b0620b08b456fd58486fcaa;hb=82f8b521a55c8985cd0189c9c71940a7312eccaa;hp=d6fe03a635307efcd19cf380792bc1b3b0f912cc;hpb=312e59b1685ed1acc688035b62700ca413294c2f;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_scale.cpp b/synfig-core/trunk/src/synfig/valuenode_scale.cpp index d6fe03a..ffe90d6 100644 --- a/synfig-core/trunk/src/synfig/valuenode_scale.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_scale.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file valuenode_scale.cpp -** \brief Template File +** \brief Implementation of the "Scale" 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 @@ -38,6 +39,7 @@ #include "vector.h" #include "time.h" #include "angle.h" +#include #endif @@ -175,11 +177,7 @@ synfig::ValueNode_Scale::operator()(Time t)const return ret; } else if(get_type()==ValueBase::TYPE_INTEGER) - { - 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); - } + return round_to_int((*value_node)(t).get(int())*(*scalar)(t).get(Real())); else if(get_type()==ValueBase::TYPE_REAL) return (*value_node)(t).get(Real())*(*scalar)(t).get(Real()); else if(get_type()==ValueBase::TYPE_TIME)