From: dooglus Date: Fri, 28 Mar 2008 10:18:52 +0000 (+0000) Subject: When looking for the closest point on a bline to a duck, use the bline's loop flag... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6e3c22a9e11fdb3339f8cc7139c661ba0f21de2e;p=synfig.git When looking for the closest point on a bline to a duck, use the bline's loop flag rather than the BLineCalcVertex's loop sub-param, since this is what tells us whether the bline is looped or not. git-svn-id: http://svn.voria.com/code@1931 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 8c0f3b7..d2ce33d 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -2590,11 +2590,12 @@ CanvasView::on_duck_changed(const synfig::Point &value,const synfigapp::ValueDes ) { 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"))); Real amount = synfig::find_closest_point( - ( *bline_vertex->get_link(bline_vertex->get_link_index_from_name("bline")) )( get_time() ), + (*bline)(get_time()), value, radius, - ( *bline_vertex->get_link(bline_vertex->get_link_index_from_name("loop")) )( get_time() ).get(bool()) + bline->get_loop() ); return canvas_interface()->change_value(synfigapp::ValueDesc(bline_vertex,bline_vertex->get_link_index_from_name("amount")), amount); } diff --git a/synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp b/synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp index 8c3dd3e..b0439a2 100644 --- a/synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp +++ b/synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp @@ -75,11 +75,12 @@ restrict_blinevertex_duck(etl::handle duck, WorkArea& w_area, synfig::Poin { synfig::Point closest_point = duck->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"))); synfig::find_closest_point( - ( *bline_vertex->get_link(bline_vertex->get_link_index_from_name("bline")) )( w_area.get_time() ), + (*bline)(w_area.get_time()), duck->get_point(), radius, - ( *bline_vertex->get_link(bline_vertex->get_link_index_from_name("loop")) )( w_area.get_time() ).get(bool()), + bline->get_loop(), &closest_point );