summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d8a7fdf)
raw | patch | inline | side by side (parent: d8a7fdf)
author | scislac <scislac@users.sourceforge.net> | |
Wed, 14 Oct 2009 21:53:02 +0000 (21:53 +0000) | ||
committer | scislac <scislac@users.sourceforge.net> | |
Wed, 14 Oct 2009 21:53:02 +0000 (21:53 +0000) |
src/extension/internal/pov-out.cpp | patch | blob | history |
index f30cbc317a4413cd6b07270bd2542a15c3bfc86e..f8916655df152490daa179fbfc84cec78f520fbd 100644 (file)
//Count the NR_CURVETOs/LINETOs (including closing line segment)
int segmentCount = 0;
for(Geom::PathVector::const_iterator it = pathv.begin(); it != pathv.end(); ++it)
- {
+ {
segmentCount += (*it).size();
- if (it->closed())
- segmentCount += 1;
+
+ // If segment not closed, add space for a closing segment.
+ if (!it->closed()) segmentCount += 1;
+
}
out("/*###################################################\n");
cminmax.expandTo(pit->initialPoint());
/**
- * For all segments in the subpath
+ * For all segments in the subpath, including extra closing segment defined by 2geom
*/
for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_closed(); ++cit)
- {
+ {
+
+ // If path is closed, we don't need extra closing segment.
+ if( pit->closed() && cit == pit->end() )
+ continue;
if( is_straight_curve(*cit) )
{
out(",\n");
else
out("\n");
+ if (segmentNr > segmentCount)
+ {
+ err("Too many segments");
+ return false;
+ }
cminmax.expandTo(cit->finalPoint());