summaryrefslogtreecommitdiff
path: root/basegfx/source/polygon/b2dsvgpolypolygon.cxx
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2012-01-17 16:32:43 +0100
committerThorsten Behrens <tbehrens@suse.com>2012-01-18 15:27:54 +0100
commit13e1fe0561facccc80628c031065ad91adfdeade (patch)
tree0fe87397f45ea7fe3910810be00a925dd56e22ba /basegfx/source/polygon/b2dsvgpolypolygon.cxx
parentb13852edb7ab68ba74fb47a38aebbda995323ecf (diff)
Fix error in handling 'z' for svg:d string parsing
Previously 'z' did not update the current point to the start point of the subpath, as required by http://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand. Fixed now, and adapted all the unit tests.
Diffstat (limited to 'basegfx/source/polygon/b2dsvgpolypolygon.cxx')
-rw-r--r--basegfx/source/polygon/b2dsvgpolypolygon.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 7a342195256a..863adf54a568 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -239,6 +239,14 @@ namespace basegfx
// remember closed state of current polygon
bIsClosed = true;
+
+ // update current point - we're back at the start
+ if( aCurrPoly.count() )
+ {
+ const B2DPoint aFirst( aCurrPoly.getB2DPoint(0) );
+ nLastX = aFirst.getX();
+ nLastY = aFirst.getY();
+ }
break;
}
@@ -1033,6 +1041,8 @@ namespace basegfx
if(aPolygon.isClosed())
{
aResult.append(lcl_getCommand('Z', 'z', bUseRelativeCoordinates));
+ // return to first point
+ aCurrentSVGPosition = aPolygon.getB2DPoint(0);
}
}
}