Code

2geom path to livarot path conversion: don't add closing line segment when it is...
authorjohanengelen <johanengelen@users.sourceforge.net>
Wed, 23 Jul 2008 17:49:49 +0000 (17:49 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Wed, 23 Jul 2008 17:49:49 +0000 (17:49 +0000)
src/livarot/PathCutting.cpp

index 7146d91f9786f44ef1423dbe8afa257f6836af54..0ad6171c1b57a8ecf5fc657cd61a960a451399a6 100644 (file)
@@ -428,11 +428,17 @@ void  Path::LoadPath(Geom::Path const &path, Geom::Matrix const &tr, bool doTran
 
     MoveTo( from_2geom(pathtr.initialPoint()) );
 
-    for(Geom::Path::const_iterator cit = pathtr.begin(); cit != pathtr.end_default(); ++cit) {
+    for(Geom::Path::const_iterator cit = pathtr.begin(); cit != pathtr.end_open(); ++cit) {
         AddCurve(*cit);
     }
 
     if (pathtr.closed()) {
+        // check if closing segment is empty before adding it
+        Geom::Curve const &crv = pathtr.back_closed();
+        if ( !crv.isDegenerate() ) {
+            AddCurve(crv);
+        }
+
         Close();
     }
 }