From: Nikita Kitaev Date: Sun, 12 Sep 2010 22:45:57 +0000 (-0700) Subject: Remove use of get_link_index_from_name where not needed X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6f2a0d4211feb1e075688ccd754bf35078c8cc3d;p=synfig.git Remove use of get_link_index_from_name where not needed --- diff --git a/synfig-studio/src/gui/duck.cpp b/synfig-studio/src/gui/duck.cpp index da571f6..ad6d7f2 100644 --- a/synfig-studio/src/gui/duck.cpp +++ b/synfig-studio/src/gui/duck.cpp @@ -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(), diff --git a/synfig-studio/src/gui/duckmatic.cpp b/synfig-studio/src/gui/duckmatic.cpp index 7fe1f19..cece9fb 100644 --- a/synfig-studio/src/gui/duckmatic.cpp +++ b/synfig-studio/src/gui/duckmatic.cpp @@ -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)); } }