Don't wrap the angle in a radial composite conversation from -180 to 180 degrees...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 2 Dec 2007 00:53:03 +0000 (00:53 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 2 Dec 2007 00:53:03 +0000 (00:53 +0000)
git-svn-id: http://svn.voria.com/code@1171 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp

index 4ed9286..ccbd1ae 100644 (file)
@@ -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;