From: johanengelen Date: Mon, 28 Sep 2009 22:15:36 +0000 (+0000) Subject: fix node counting for "moveto"-only paths. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=124efe128854b7c9eb3a8197e06d1a2f8a673746;p=inkscape.git fix node counting for "moveto"-only paths. --- 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--; } } }