Remove use of get_link_index_from_name where not needed
authorNikita Kitaev <nikitakit@gmail.com>
Sun, 12 Sep 2010 22:45:57 +0000 (15:45 -0700)
committerNikita Kitaev <nikitakit@gmail.com>
Sun, 12 Sep 2010 22:45:57 +0000 (15:45 -0700)
synfig-studio/src/gui/duck.cpp
synfig-studio/src/gui/duckmatic.cpp

index da571f6..ad6d7f2 100644 (file)
@@ -238,7 +238,7 @@ Duck::set_sub_trans_point(const synfig::Point &x, const synfig::Time &time)
                {
                        synfig::Point closest_point = get_point();
                        synfig::Real radius = 0.0;
-                       ValueNode_BLine::Handle bline = ValueNode_BLine::Handle::cast_dynamic(bline_vertex->get_link(bline_vertex->get_link_index_from_name("bline")));
+                       ValueNode_BLine::Handle bline = ValueNode_BLine::Handle::cast_dynamic(bline_vertex->get_link("bline"));
                        synfig::find_closest_point(
                                (*bline)(time),
                                get_point(),
index 7fe1f19..cece9fb 100644 (file)
@@ -475,17 +475,16 @@ Duckmatic::update_ducks()
                                        if ( (*iter)->get_origin_duck()==duck  /*&& !duck_is_selected(*iter)*/ )
                                        {
                                                synfig::Real radius = 0.0;
-                                               ValueNode_BLine::Handle bline(ValueNode_BLine::Handle::cast_dynamic(bline_vertex->get_link(bline_vertex->get_link_index_from_name("bline"))));
+                                               ValueNode_BLine::Handle bline(ValueNode_BLine::Handle::cast_dynamic(bline_vertex->get_link("bline")));
                                                Real amount = synfig::find_closest_point((*bline)(time), duck->get_point(), radius, bline->get_loop());
 
-                                               int vertex_amount_index(bline_vertex->get_link_index_from_name("amount"));
-                                               ValueNode::Handle vertex_amount_value_node(bline_vertex->get_link(vertex_amount_index));
+                                               ValueNode::Handle vertex_amount_value_node(bline_vertex->get_link("amount"));
 
 
                                                ValueNode::Handle duck_value_node((*iter)->get_value_desc().get_value_node());
                                                if (ValueNode_BLineCalcTangent::Handle bline_tangent = ValueNode_BLineCalcTangent::Handle::cast_dynamic(duck_value_node))
                                                {
-                                                       if (bline_tangent->get_link(bline_tangent->get_link_index_from_name("amount")) == vertex_amount_value_node)
+                                                       if (bline_tangent->get_link("amount") == vertex_amount_value_node)
                                                        {
                                                                switch (bline_tangent->get_type())
                                                                {
@@ -509,7 +508,7 @@ Duckmatic::update_ducks()
                                                }
                                                else if (ValueNode_BLineCalcWidth::Handle bline_width = ValueNode_BLineCalcWidth::Handle::cast_dynamic(duck_value_node))
                                                {
-                                                       if (bline_width->get_link(bline_width->get_link_index_from_name("amount")) == vertex_amount_value_node)
+                                                       if (bline_width->get_link("amount") == vertex_amount_value_node)
                                                                (*iter)->set_point(Point((*bline_width)(time, amount).get(Real()), 0));
                                                }
                                        }