summaryrefslogtreecommitdiffstats
path: root/src/2geom
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-07-15 12:41:14 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-07-15 12:41:14 +0000
commit3c31e0c3b934d89100b8df736f5017225b89ce86 (patch)
tree410a66d22ff4535decde7b7c84913019fd4a4cc3 /src/2geom
parentNew LPE: Ruler (diff)
downloadinkscape-3c31e0c3b934d89100b8df736f5017225b89ce86.tar.gz
inkscape-3c31e0c3b934d89100b8df736f5017225b89ce86.zip
Cherry-pick of 2geom update (re. 1488); prevent crash during Path->Piecewise conversion for zero length paths
(bzr r6320)
Diffstat (limited to 'src/2geom')
-rw-r--r--src/2geom/path.h7
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;
}