diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2015-07-05 01:47:36 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2015-07-05 01:47:36 +0000 |
| commit | 009833c1d6be271d611c183aae781e41b71ca927 (patch) | |
| tree | 52108612e2f130dc9a5da8a5cb7dd0398cc91708 /src/display/curve.cpp | |
| parent | Translation. Danish translation update. (diff) | |
| download | inkscape-009833c1d6be271d611c183aae781e41b71ca927.tar.gz inkscape-009833c1d6be271d611c183aae781e41b71ca927.zip | |
Fix compilation failure in make check
(bzr r14228)
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..2f422c151 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(1ul, it->size_closed()); + nr += psize; } return nr; |
