From f9a269402b4bc1d6a77834b9247859ce62a358c9 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 3 Aug 2008 20:00:39 +0000 Subject: [PATCH] update 2geom: fixes long standing bug where closed paths are not converted correctly back from pwd2; causing lpe-bend to fail for example on a simple rectangle. --- src/2geom/sbasis-to-bezier.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/2geom/sbasis-to-bezier.cpp b/src/2geom/sbasis-to-bezier.cpp index a046d7dbe..cbddccda8 100644 --- a/src/2geom/sbasis-to-bezier.cpp +++ b/src/2geom/sbasis-to-bezier.cpp @@ -225,12 +225,13 @@ path_from_piecewise(Geom::Piecewise > 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: -- 2.30.2