When looking for the closest point on a bline to a duck, use the bline's loop flag...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 28 Mar 2008 10:18:52 +0000 (10:18 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 28 Mar 2008 10:18:52 +0000 (10:18 +0000)
git-svn-id: http://svn.voria.com/code@1931 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/canvasview.cpp
synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp

index 8c0f3b7..d2ce33d 100644 (file)
@@ -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);
        }
index 8c3dd3e..b0439a2 100644 (file)
@@ -75,11 +75,12 @@ restrict_blinevertex_duck(etl::handle<Duck> 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
                );