summaryrefslogtreecommitdiffstats
path: root/src/display/curve.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2009-09-28 22:15:36 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2009-09-28 22:15:36 +0000
commitd4783ff64d331ed663f7fa98d50f08280b22b0e8 (patch)
treef5be73cdf49a62d6b62d4b8e43c213a1a6f61256 /src/display/curve.cpp
parentFix the mkNEWS script, and make it use w3m, which is nowadays (diff)
downloadinkscape-d4783ff64d331ed663f7fa98d50f08280b22b0e8.tar.gz
inkscape-d4783ff64d331ed663f7fa98d50f08280b22b0e8.zip
fix node counting for "moveto"-only paths.
(bzr r8669)
Diffstat (limited to 'src/display/curve.cpp')
-rw-r--r--src/display/curve.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 5a1e2abeb..7d7dbc987 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -629,10 +629,14 @@ SPCurve::nodes_in_path() const
nr++; // count last node (this works also for closed paths because although they don't have a 'last node', they do have an extra segment
- if (it->closed()) {
+ // do not count closing knot double for zero-length closing line segments
+ // however, if the path is only a moveto, and is closed, do not subtract 1 (otherwise the result will be zero nodes)
+ if ( it->closed()
+ && ((*it).size() != 0) )
+ {
Geom::Curve const &c = it->back_closed();
if (are_near(c.initialPoint(), c.finalPoint())) {
- nr--; // do not count closing knot double for zero-length closing line segments
+ nr--;
}
}
}