diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-07-14 21:09:41 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-07-14 21:09:41 +0000 |
| commit | d32efb61f1c2c18d1018e510bbe9bafc04a03905 (patch) | |
| tree | b447bf9856baf1cf485e38c4ce55edb27285129e /src/sp-shape.cpp | |
| parent | Merged from trunk (r12305) (diff) | |
| parent | Minor C++ish refactoring pass. (diff) | |
| download | inkscape-d32efb61f1c2c18d1018e510bbe9bafc04a03905.tar.gz inkscape-d32efb61f1c2c18d1018e510bbe9bafc04a03905.zip | |
Merged from trunk (r12419).
(bzr r11608.1.107)
Diffstat (limited to 'src/sp-shape.cpp')
| -rw-r--r-- | src/sp-shape.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index b1fd31f3d..8f3d5117f 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -783,6 +783,13 @@ int SPShape::hasMarkers() const all three settings. This should be fixed later such that if 'marker' is specified, then all three should appear. */ + // Ignore markers for objects which are inside markers themselves. + for (SPObject *parent = this->parent; parent != NULL; parent = parent->parent) { + if(SP_IS_MARKER(parent)) { + return 0; + } + } + return ( this->_curve && (this->_marker[SP_MARKER_LOC] || @@ -805,8 +812,8 @@ int SPShape::numberOfMarkers(int type) if (pathv.size() == 0) { return 0; } - switch(type) { + case SP_MARKER_LOC: { if ( this->_marker[SP_MARKER_LOC] ) { @@ -830,7 +837,9 @@ int SPShape::numberOfMarkers(int type) for(Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) { n += path_it->size_default() + 1; } - return n - 2; // minus the start and end marker. + n = (n > 1) ? (n - 2) : 0; // Minus the start and end marker, but never negative. + // A path or polyline may have only one point. + return n; } else { return 0; } |
