diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-07-06 10:02:21 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-07-06 10:02:21 +0000 |
| commit | b98fbdac9b7b9a75f2c198ff5b9c92389b927fe0 (patch) | |
| tree | 86c8635fbe4a8f4e3171cb47d28d1a16f569a58f /src/display/curve.cpp | |
| parent | Fixes from branch review (diff) | |
| parent | Extensions. Fix for Bug #760429 (Scour extension files organization). (diff) | |
| download | inkscape-b98fbdac9b7b9a75f2c198ff5b9c92389b927fe0.tar.gz inkscape-b98fbdac9b7b9a75f2c198ff5b9c92389b927fe0.zip | |
update to trunk
(bzr r13645.1.103)
Diffstat (limited to 'src/display/curve.cpp')
| -rw-r--r-- | src/display/curve.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp index d236d81cf..386c63166 100644 --- a/src/display/curve.cpp +++ b/src/display/curve.cpp @@ -627,20 +627,10 @@ SPCurve::nodes_in_path() const { size_t nr = 0; for(Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) { - nr += (*it).size(); - - 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 - - // 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--; - } - } + // if the path does not have any segments, it is a naked moveto, + // and therefore any path has at least one valid node + size_t psize = std::max<size_t>(1, it->size_closed()); + nr += psize; } return nr; |
