diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-08-19 13:18:04 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-08-19 13:18:04 +0000 |
| commit | f32471079e3f6c4cbd223a7b5c4d164a9315a912 (patch) | |
| tree | b220212e020290d91adb89d6ae43057f80a00cd4 /src/2geom | |
| parent | Added a PDF import settings dialog (diff) | |
| download | inkscape-f32471079e3f6c4cbd223a7b5c4d164a9315a912.tar.gz inkscape-f32471079e3f6c4cbd223a7b5c4d164a9315a912.zip | |
* Fixed path-along-path with correct filling now! (2geom fix)
* sp_shape_update_effect is now called much less than before.
(bzr r3524)
Diffstat (limited to 'src/2geom')
| -rw-r--r-- | src/2geom/sbasis-to-bezier.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/2geom/sbasis-to-bezier.cpp b/src/2geom/sbasis-to-bezier.cpp index e823b29ca..613c39288 100644 --- a/src/2geom/sbasis-to-bezier.cpp +++ b/src/2geom/sbasis-to-bezier.cpp @@ -184,7 +184,7 @@ path_from_sbasis(D2<SBasis> const &B, double tol) { //TODO: some of this logic should be lifted into svg-path std::vector<Geom::Path> path_from_piecewise(Geom::Piecewise<Geom::D2<Geom::SBasis> > const &B, double tol) { - +/* Geom::PathBuilder pb; if(B.size() == 0) return pb.peek(); Geom::Point start = B[0].at0(); @@ -205,11 +205,39 @@ path_from_piecewise(Geom::Piecewise<Geom::D2<Geom::SBasis> > const &B, double to if(i+1 >= B.size()) break; start = B[i+1].at0(); pb.moveTo(start); + i++; } build_from_sbasis(pb, B[i], tol); } pb.finish(); return pb.peek(); +*/ + Geom::PathBuilder pb; + if(B.size() == 0) return pb.peek(); + Geom::Point start = B[0].at0(); + pb.moveTo(start); + for(unsigned i = 0; ; i++) { + if(i+1 == B.size() || !near(B[i+1].at0(), B[i].at1(), tol)) { + //start of a new path + if(near(start, B[i].at1())) { + //it's closed + pb.closePath(); + if(sbasis_size(B[i]) <= 1) { + //last line seg already there + goto no_add; + } + } + build_from_sbasis(pb, B[i], tol); + no_add: + if(i+1 >= B.size()) break; + start = B[i+1].at0(); + pb.moveTo(start); + } else { + build_from_sbasis(pb, B[i], tol); + } + } + pb.finish(); + return pb.peek(); } }; |
