diff options
| author | JF Barraud <jf.barraud@gmail.com> | 2008-09-15 22:03:54 +0000 |
|---|---|---|
| committer | jfbarraud <jfbarraud@users.sourceforge.net> | 2008-09-15 22:03:54 +0000 |
| commit | e5532300a1928a770b01018aaeaf94e021a9ce1b (patch) | |
| tree | 02fe7a210b40cf049b9de3d4a5de3d280eac7c79 | |
| parent | fix first argument being lost in shell mode (diff) | |
| download | inkscape-e5532300a1928a770b01018aaeaf94e021a9ce1b.tar.gz inkscape-e5532300a1928a770b01018aaeaf94e021a9ce1b.zip | |
minor bug fix in portion(pw,a,b) when b is a cut of pw.
(bzr r6814)
| -rw-r--r-- | src/2geom/piecewise.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h index 73fc76e2f..3979643b2 100644 --- a/src/2geom/piecewise.h +++ b/src/2geom/piecewise.h @@ -372,13 +372,14 @@ Piecewise<T> portion(const Piecewise<T> &pw, double from, double to) { unsigned i = pw.segN(from); ret.push_cut(from); - if(i == pw.size() - 1 || to < pw.cuts[i + 1]) { //to/from inhabit the same segment + if(i == pw.size() - 1 || to <= pw.cuts[i + 1]) { //to/from inhabit the same segment ret.push(elem_portion(pw, i, from, to), to); return ret; } ret.push_seg(portion( pw[i], pw.segT(from, i), 1.0 )); i++; unsigned fi = pw.segN(to, i); + if (to == pw.cuts[fi]) fi-=1; ret.segs.insert(ret.segs.end(), pw.segs.begin() + i, pw.segs.begin() + fi); //copy segs ret.cuts.insert(ret.cuts.end(), pw.cuts.begin() + i, pw.cuts.begin() + fi + 1); //and their cuts |
