From: dooglus Date: Sun, 2 Dec 2007 00:53:03 +0000 (+0000) Subject: Don't wrap the angle in a radial composite conversation from -180 to 180 degrees... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4742c682ea173332f2d28428cfd7d40e3693b652;p=synfig.git Don't wrap the angle in a radial composite conversation from -180 to 180 degrees when manipulating it using a duck. Instead, modify the previous value by something between -180 and 180 degrees. git-svn-id: http://svn.voria.com/code@1171 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp index 4ed9286..ccbd1ae 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp @@ -334,9 +334,14 @@ Action::ValueDescSet::prepare() { case ValueBase::TYPE_VECTOR: { + Angle old_angle = (*(ValueNode_RadialComposite::Handle::cast_dynamic( + value_desc.get_value_node())->get_link_vfunc(1)))(time).get(Angle()); Vector vect(value.get(Vector())); components[0]=vect.mag(); - components[1]=Angle(Angle::tan(vect[1],vect[0])); + Angle change = Angle(Angle::tan(vect[1],vect[0])) - old_angle; + while (change < Angle::deg(-180)) change += Angle::deg(360); + while (change > Angle::deg(180)) change -= Angle::deg(360); + components[1]=old_angle + change; n_components=2; } break;