summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2f5c070)
raw | patch | inline | side by side (parent: 2f5c070)
author | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 15 Jul 2008 12:41:14 +0000 (12:41 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 15 Jul 2008 12:41:14 +0000 (12:41 +0000) |
src/2geom/path.h | patch | blob | history |
diff --git a/src/2geom/path.h b/src/2geom/path.h
index 1c142f98d542e42d74d2a9fc079df629136af09b..1e9aa1d42cbd805c2daf94340beb84d239869b49 100644 (file)
--- a/src/2geom/path.h
+++ b/src/2geom/path.h
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;
}