X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_blinecalctangent.cpp;h=0d271570ae9738df08fa593cc1f699ff02b658d4;hb=3c1610c55889e3169142d2af1eece43c63022672;hp=e8fc826cdd5177e8ba548476a138b6c456c51972;hpb=37600b4b217caa5e316984ec0b035c5e8f9698af;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp b/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp index e8fc826..0d27157 100644 --- a/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp @@ -1,12 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file valuenode_blinecalctangent.cpp -** \brief Template File +** \brief Implementation of the "BLine Tangent" valuenode conversion. ** ** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2007 Chris Moore +** Copyright (c) 2007, 2008 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 @@ -59,7 +59,7 @@ ValueNode_BLineCalcTangent::ValueNode_BLineCalcTangent(const ValueBase::Type &x) LinkableValueNode(x) { if(x!=ValueBase::TYPE_ANGLE && x!=ValueBase::TYPE_VECTOR) - throw Exception::BadType(ValueBase::type_name(x)); + throw Exception::BadType(ValueBase::type_local_name(x)); ValueNode_BLine* value_node(new ValueNode_BLine()); set_link("bline",value_node); @@ -127,21 +127,12 @@ ValueNode_BLineCalcTangent::operator()(Time t)const blinepoint0.get_tangent2(), blinepoint1.get_tangent1()); etl::derivative< etl::hermite > deriv(curve); -#ifdef ETL_FIXED_DERIVATIVE switch (get_type()) { - case ValueBase::TYPE_ANGLE: return (deriv(amount-from_vertex)*(0.5)).angle(); - case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(0.5); + case ValueBase::TYPE_ANGLE: return deriv(amount-from_vertex).angle(); + case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex); default: assert(0); return ValueBase(); } -#else - switch (get_type()) - { - case ValueBase::TYPE_ANGLE: return (deriv(amount-from_vertex)*(-0.5)).angle(); - case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(-0.5); - default: assert(0); return ValueBase(); - } -#endif } String @@ -157,23 +148,15 @@ ValueNode_BLineCalcTangent::get_local_name()const } bool -ValueNode_BLineCalcTangent::set_link_vfunc(int i,ValueNode::Handle x) +ValueNode_BLineCalcTangent::set_link_vfunc(int i,ValueNode::Handle value) { assert(i>=0 && i=0 && i=0 && i=0 && i