`blinepointtangentsplit.cpp' and `blinepointtangentmerge.cpp' should just take care...
[synfig.git] / synfig-studio / trunk / src / synfigapp / actions / blinepointtangentmerge.cpp
index fd32ef1..8cdeb38 100644 (file)
@@ -142,63 +142,19 @@ Action::BLinePointTangentMerge::prepare()
 
        Action::Handle action;
 
-       {
-               action=Action::create("value_desc_set");
-               if(!action)
-                       throw Error(_("Couldn't find action \"value_desc_set\""));
-
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,3));
-               action->set_param("time",time);
-               action->set_param("new_value",synfig::ValueBase(false));
+       action=Action::create("value_desc_set");
+       if(!action)
+               throw Error(_("Couldn't find action \"value_desc_set\""));
 
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
+       action->set_param("canvas",get_canvas());
+       action->set_param("canvas_interface",get_canvas_interface());
+       action->set_param("value_desc",ValueDesc(value_node,3));
+       action->set_param("time",time);
+       action->set_param("new_value",synfig::ValueBase(false));
 
-               add_action(action);
-       }
+       assert(action->is_ready());
+       if(!action->is_ready())
+               throw Error(Error::TYPE_NOTREADY);
 
-       // the merged tangent should be the average of the 2 tangents we're merging
-       ValueBase average(((Vector)((*value_node->get_link("t1"))(time)) +
-                                          (Vector)((*value_node->get_link("t2"))(time))) / 2);
-
-       {
-               // set tangent1
-               action=Action::create("value_desc_set");
-               if(!action)
-                       throw Error(_("Couldn't find action \"value_desc_set\""));
-
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,4));
-               action->set_param("time",time);
-               action->set_param("new_value",average);
-
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-               add_action(action);
-       }
-
-       {
-               // set tangent2
-               action=Action::create("value_desc_set");
-               if(!action)
-                       throw Error(_("Couldn't find action \"value_desc_set\""));
-
-               action->set_param("canvas",get_canvas());
-               action->set_param("canvas_interface",get_canvas_interface());
-               action->set_param("value_desc",ValueDesc(value_node,5));
-               action->set_param("time",time);
-               action->set_param("new_value",average);
-
-               assert(action->is_ready());
-               if(!action->is_ready())
-                       throw Error(Error::TYPE_NOTREADY);
-
-               add_action(action);
-       }
+       add_action(action);
 }