diff options
| -rw-r--r-- | src/2geom/path.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/2geom/path.h b/src/2geom/path.h index 1c142f98d..1e9aa1d42 100644 --- a/src/2geom/path.h +++ b/src/2geom/path.h @@ -270,12 +270,19 @@ public: Piecewise<D2<SBasis> > ret; ret.push_cut(0); unsigned i = 1; + bool degenerate = true; // pw<d2<>> is always open. so if path is closed, add closing segment as well to pwd2. for(const_iterator it = begin(); it != end_default(); ++it) { if (!it->isDegenerate()) { ret.push(it->toSBasis(), i++); + degenerate = false; } } + if (degenerate) { + // if path only contains degenerate curves, no second cut is added + // so we need to create at least one segment manually + ret = Piecewise<D2<SBasis> >(initialPoint()); + } return ret; } |
