From: cilix42 Date: Tue, 15 Jul 2008 12:41:14 +0000 (+0000) Subject: Cherry-pick of 2geom update (re. 1488); prevent crash during Path->Piecewise conversi... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b387f6954eef6c426fedd52f20bf5f04dcd47816;p=inkscape.git Cherry-pick of 2geom update (re. 1488); prevent crash during Path->Piecewise conversion for zero length paths --- 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 > ret; ret.push_cut(0); unsigned i = 1; + bool degenerate = true; // pw> 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 >(initialPoint()); + } return ret; }