From: dooglus Date: Wed, 20 Feb 2008 15:30:33 +0000 (+0000) Subject: Draw in the complete outline of a selected polygon if it is 'looped'. This allows... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=84589d82b412a2a35fcb68995148e2a01794227c;p=synfig.git Draw in the complete outline of a selected polygon if it is 'looped'. This allows the creation of new points on any existing side. git-svn-id: http://svn.voria.com/code@1787 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index 084f642..75212d4 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -1695,6 +1695,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleget_contained_type()==ValueBase::TYPE_VECTOR) { Bezier bezier; + etl::handle first_duck, duck; int first = -1; for(i=0;ilink_count();i++) { @@ -1702,11 +1703,14 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle duck(last_duck()); + duck = last_duck(); // remember the index of the first vertex we didn't skip if (first == -1) + { first = i; + first_duck = duck; + } if(param_desc) { @@ -1741,6 +1745,27 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleget_loop() && first != -1 && first_duck != duck) + { + duck = first_duck; + + bezier.p1=bezier.p2;bezier.c1=bezier.c2; + bezier.p2=bezier.c2=duck; + + handle bezier_(new Bezier()); + bezier_->p1=bezier.p1; + bezier_->c1=bezier.c1; + bezier_->p2=bezier.p2; + bezier_->c2=bezier.c2; + add_bezier(bezier_); + last_bezier()->signal_user_click(2).connect( + sigc::bind( + sigc::mem_fun( + *canvas_view, + &studio::CanvasView::popup_param_menu_bezier), + synfigapp::ValueDesc(value_node,first))); + } } /*else if(value_node->get_contained_type()==ValueBase::TYPE_SEGMENT) {