diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-07-13 22:46:59 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-07-13 22:46:59 +0000 |
| commit | 95c4982d8200b593756f428f8cb7cd8c9c3503ce (patch) | |
| tree | cbc530439bd7f77d0f76bae2cbe220a0d87917a2 /src/nodepath.cpp | |
| parent | fix warning (diff) | |
| download | inkscape-95c4982d8200b593756f428f8cb7cd8c9c3503ce.tar.gz inkscape-95c4982d8200b593756f428f8cb7cd8c9c3503ce.zip | |
if the closing line segment has zero length, don't include it in the nodepath!
(bzr r6288)
Diffstat (limited to 'src/nodepath.cpp')
| -rw-r--r-- | src/nodepath.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp index aec5ff058..89d1d3e8b 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -525,9 +525,14 @@ static void subpaths_from_pathvector(Inkscape::NodePath::Path *np, Geom::PathVec if (pit->closed()) { // Add last knot (because sp_nodepath_subpath_close kills the last knot) - // Remember that last closing segment is always a lineto, and that its endpoint is the path's initialPoint because the path is closed - NR::Point pos = from_2geom(pit->initialPoint()) * np->i2d; - sp_nodepath_node_new(sp, NULL, t[i++], NR_LINETO, &pos, &pos, &pos); + /* Remember that last closing segment is always a lineto, but its length can be zero if the path is visually closed already + * If the length is zero, don't add it to the nodepath. */ + Geom::Curve const &back = pit->back_closed(); + if ( back.initialPoint() != back.finalPoint() ) { + NR::Point pos = from_2geom(back.finalPoint()) * np->i2d; + sp_nodepath_node_new(sp, NULL, t[i++], NR_LINETO, &pos, &pos, &pos); + } + sp_nodepath_subpath_close(sp); } } |
