Fix handling of segments so that the examples/walk/walk.sifz file will load correctly.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 7 Mar 2008 23:24:59 +0000 (23:24 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 7 Mar 2008 23:24:59 +0000 (23:24 +0000)
git-svn-id: http://svn.voria.com/code@1876 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/mod_geometry/outline.cpp
synfig-core/trunk/src/modules/mod_geometry/region.cpp

index ca45878..62c0fa4 100644 (file)
@@ -183,6 +183,14 @@ Outline::sync()
 #if 1
 
        const bool loop(bline.get_loop());
+
+       ValueNode_BLine::Handle bline_valuenode;
+       if (bline.get_contained_type() == ValueBase::TYPE_SEGMENT)
+       {
+               bline_valuenode = ValueNode_BLine::create(bline);
+               bline = (*bline_valuenode)(0);
+       }
+
        const vector<synfig::BLinePoint> bline_(bline.get_list().begin(),bline.get_list().end());
 #define bline bline_
 
index baa5780..989fe8d 100644 (file)
@@ -94,9 +94,9 @@ void
 Region::sync()
 {
        if(bline.get_contained_type()==ValueBase::TYPE_BLINEPOINT)
-       {
                segment_list=convert_bline_to_segment_list(bline);
-       }
+       else if(bline.get_contained_type()==ValueBase::TYPE_SEGMENT)
+               segment_list=vector<synfig::Segment>(bline.get_list().begin(), bline.get_list().end());
        else
        {
                synfig::warning("Region: incorrect type on bline, layer disabled");