Fix handling of boolean flags in elliptical path commands (#183)
* properly parse paths without space after boolean flags (fixes #161) * omit space after boolean flag to shave off a few bytes when not using renderer workarounds
This commit is contained in:
parent
ba7f4b5f18
commit
103dcc0a48
4 changed files with 63 additions and 13 deletions
18
testscour.py
18
testscour.py
|
|
@ -1101,6 +1101,24 @@ class ChangeQuadToShorthandInPath(unittest.TestCase):
|
|||
'Did not change quadratic curves into shorthand curve segments in path')
|
||||
|
||||
|
||||
class BooleanFlagsInEllipticalPath(unittest.TestCase):
|
||||
|
||||
def test_omit_spaces(self):
|
||||
doc = scourXmlFile('unittests/path-elliptical-flags.svg', parse_args(['--no-renderer-workaround']))
|
||||
paths = doc.getElementsByTagNameNS(SVGNS, 'path')
|
||||
for path in paths:
|
||||
self.assertEqual(path.getAttribute('d'), 'm0 0a100 50 0 00100 50',
|
||||
'Did not ommit spaces after boolean flags in elliptical arg path command')
|
||||
|
||||
def test_output_spaces_with_renderer_workaround(self):
|
||||
doc = scourXmlFile('unittests/path-elliptical-flags.svg', parse_args(['--renderer-workaround']))
|
||||
paths = doc.getElementsByTagNameNS(SVGNS, 'path')
|
||||
for path in paths:
|
||||
self.assertEqual(path.getAttribute('d'), 'm0 0a100 50 0 0 0 100 50',
|
||||
'Did not output spaces after boolean flags in elliptical arg path command '
|
||||
'with renderer workaround')
|
||||
|
||||
|
||||
class DoNotOptimzePathIfLarger(unittest.TestCase):
|
||||
|
||||
def runTest(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue