summaryrefslogtreecommitdiffstats
path: root/src/display/curve.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-09-13 21:18:32 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-09-13 21:18:32 +0000
commit643cc11d6ec0363c9dbbe0ccf52a1eaff65c59e7 (patch)
tree52112f8c14e805e414f10fc6ee147eafd57b52b0 /src/display/curve.cpp
parentMore sensible behaviour of the treat-selection-as-group option in align & dis... (diff)
downloadinkscape-643cc11d6ec0363c9dbbe0ccf52a1eaff65c59e7.tar.gz
inkscape-643cc11d6ec0363c9dbbe0ccf52a1eaff65c59e7.zip
fix UI node counting
(bzr r6804)
Diffstat (limited to 'src/display/curve.cpp')
-rw-r--r--src/display/curve.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 0b560883b..52ffe4f5b 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -593,6 +593,8 @@ SPCurve::move_endpoints(Geom::Point const &new_p0, Geom::Point const &new_p1)
/**
* returns the number of nodes in a path, used for statusbar text when selecting an spcurve.
+ * Sum of nodes in all the paths. When a path is closed, and its closing line segment is of zero-length,
+ * this function will not count the closing knot double (so basically ignores the closing line segment when it has zero length)
*/
guint
SPCurve::nodes_in_path() const
@@ -602,6 +604,13 @@ SPCurve::nodes_in_path() const
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
+
+ if (it->closed()) {
+ 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
+ }
+ }
}
return nr;