summaryrefslogtreecommitdiffstats
path: root/src/sp-shape.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-04 23:07:47 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-04 23:07:47 +0000
commit20e623e7c95e8aebb50d93ddcf77103ba5bd176e (patch)
tree0e59d9a3b62a9b5e79655426937754413bb093e2 /src/sp-shape.cpp
parentuse if(dynamic_cast<>) instead of if(typeid==) to check 2geom segment types f... (diff)
downloadinkscape-20e623e7c95e8aebb50d93ddcf77103ba5bd176e.tar.gz
inkscape-20e623e7c95e8aebb50d93ddcf77103ba5bd176e.zip
2geomify calculation of number of markers on a path
(bzr r6159)
Diffstat (limited to 'src/sp-shape.cpp')
-rw-r--r--src/sp-shape.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index c01f8535d..54f674f6b 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -1060,9 +1060,14 @@ sp_shape_has_markers (SPShape const *shape)
int
sp_shape_number_of_markers (SPShape *shape, int type)
{
- int n = 0;
- for (NArtBpath const* bp = SP_CURVE_BPATH(shape->curve); bp->code != NR_END; bp++) {
- if (sp_shape_marker_required (shape, type, bp)) {
+ Geom::PathVector const & pathv = shape->curve->get_pathvector();
+
+ guint n = shape->marker[SP_MARKER_LOC_START] ? pathv.size() : 0;
+
+ for(Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) {
+ n += shape->marker[SP_MARKER_LOC_MID] ? path_it->size() : 0;
+
+ if ( shape->marker[SP_MARKER_LOC_END] && !path_it->empty()) {
n++;
}
}