Code

update 2geom: fixes long standing bug where closed paths are not converted correctly...
authorjohanengelen <johanengelen@users.sourceforge.net>
Sun, 3 Aug 2008 20:00:39 +0000 (20:00 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sun, 3 Aug 2008 20:00:39 +0000 (20:00 +0000)
src/2geom/sbasis-to-bezier.cpp

index a046d7dbe04e98577e6b9819a9c6663937933ff9..cbddccda86cabbd8771797aa1fa282d12cf24afa 100644 (file)
@@ -225,12 +225,13 @@ path_from_piecewise(Geom::Piecewise<Geom::D2<Geom::SBasis> > const &B, double to
         if(i+1 == B.size() || !are_near(B[i+1].at0(), B[i].at1(), tol)) {
             //start of a new path
             if(are_near(start, B[i].at1()) && sbasis_size(B[i]) <= 1) {
-                //last line seg already there
+                pb.closePath();
+                //last line seg already there (because of .closePath())
                 goto no_add;
             }
             build_from_sbasis(pb, B[i], tol, only_cubicbeziers);
             if(are_near(start, B[i].at1())) {
-                //it's closed
+                //it's closed, the last closing segment was not a straight line so it needed to be added, but still make it closed here with degenerate straight line.
                 pb.closePath();
             }
           no_add: