Turning the first point in a polygon 'off' was causing a crash.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 20 Feb 2008 15:30:19 +0000 (15:30 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 20 Feb 2008 15:30:19 +0000 (15:30 +0000)
git-svn-id: http://svn.voria.com/code@1786 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/duckmatic.cpp

index 15ee0c9..084f642 100644 (file)
@@ -1695,6 +1695,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle<Canva
                        if(value_node->get_contained_type()==ValueBase::TYPE_VECTOR)
                        {
                                Bezier bezier;
+                               int first = -1;
                                for(i=0;i<value_node->link_count();i++)
                                {
                                        if(!value_node->list[i].status_at_time(get_time()))
@@ -1703,6 +1704,10 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle<Canva
                                                return false;
                                        etl::handle<Duck> duck(last_duck());
 
+                                       // remember the index of the first vertex we didn't skip
+                                       if (first == -1)
+                                               first = i;
+
                                        if(param_desc)
                                        {
                                                                synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_origin());
@@ -1720,7 +1725,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle<Canva
                                        bezier.p1=bezier.p2;bezier.c1=bezier.c2;
                                        bezier.p2=bezier.c2=duck;
 
-                                       if(i>0)
+                                       if (first != i)
                                        {
                                                handle<Bezier> bezier_(new Bezier());
                                                bezier_->p1=bezier.p1;