use join in clean animated path
And test for empty values.
This commit is contained in:
parent
a1b72d5643
commit
03025e7fc2
1 changed files with 3 additions and 4 deletions
|
|
@ -2772,11 +2772,10 @@ def clean_animated_path(element, options, stats):
|
||||||
These are ';' delimited path data that must keep the same number of nodes, so the only cleaning is via serializePath
|
These are ';' delimited path data that must keep the same number of nodes, so the only cleaning is via serializePath
|
||||||
"""
|
"""
|
||||||
oldPathStr = element.getAttribute('values')
|
oldPathStr = element.getAttribute('values')
|
||||||
|
if oldPathStr=="":
|
||||||
|
return
|
||||||
oldPathStrs = oldPathStr.split(';')
|
oldPathStrs = oldPathStr.split(';')
|
||||||
newPathStr = ""
|
newPathStr = ";".join(map(lambda s:serializePath(svg_parser.parse(s),options),oldPathStrs)
|
||||||
for oldPathStrPart in oldPathStrs:
|
|
||||||
path = svg_parser.parse(oldPathStrPart)
|
|
||||||
newPathStr += serializePath(path, options) + " ;\n"
|
|
||||||
element.setAttribute('values', newPathStr)
|
element.setAttribute('values', newPathStr)
|
||||||
|
|
||||||
def parseListOfPoints(s):
|
def parseListOfPoints(s):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue