diff --git a/scour/scour.py b/scour/scour.py index 7055db0..ebc44c6 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -2539,7 +2539,7 @@ def serializePath(pathObj, options): """ # elliptical arc commands must have comma/wsp separating the coordinates # this fixes an issue outlined in Fix https://bugs.launchpad.net/scour/+bug/412754 - return ''.join([cmd + scourCoordinates(data, options, (cmd == 'a'), cmd) for cmd, data in pathObj]) + return ''.join([cmd + scourCoordinates(data, options, path_cmd=cmd) for cmd, data in pathObj]) def serializeTransform(transformObj): @@ -2554,7 +2554,7 @@ def serializeTransform(transformObj): ) -def scourCoordinates(data, options, force_whitespace=False, cmd=''): +def scourCoordinates(data, options, force_whitespace=False, path_cmd=''): """ Serializes coordinate data with some cleanups: - removes all trailing zeros after the decimal @@ -2567,7 +2567,7 @@ def scourCoordinates(data, options, force_whitespace=False, cmd=''): c = 0 previousCoord = '' for coord in data: - cp = ((cmd == 'c' and (c % 6) < 4) or (cmd == 's' and (c % 4) < 2)) + cp = ((path_cmd == 'c' and (c % 6) < 4) or (path_cmd == 's' and (c % 4) < 2)) scouredCoord = scourUnitlessLength(coord, needsRendererWorkaround=options.renderer_workaround, isControlPoint=cp) diff --git a/testscour.py b/testscour.py index 29b70a9..d73090d 100755 --- a/testscour.py +++ b/testscour.py @@ -1640,15 +1640,6 @@ class PropagateCommonAttributesUp(unittest.TestCase): 'Did not move common fill attribute to grandparent') -class PathEllipticalArcParsingCommaWsp(unittest.TestCase): - - def runTest(self): - p = scourXmlFile('unittests/path-elliptical-arc-parsing.svg') \ - .getElementsByTagNameNS(SVGNS, 'path')[0] - self.assertEqual(p.getAttribute('d'), 'm100 100a100 100 0 1 1 -50 100z', - 'Did not parse elliptical arc command properly') - - class RemoveUnusedAttributesOnParent(unittest.TestCase): def runTest(self): diff --git a/unittests/path-elliptical-arc-parsing.svg b/unittests/path-elliptical-arc-parsing.svg deleted file mode 100644 index 77a8cbd..0000000 --- a/unittests/path-elliptical-arc-parsing.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -