[SVGExporter] Remove f-strings

This commit is contained in:
Gabriele Buondonno 2020-10-19 11:11:45 +02:00
parent 972d985421
commit 482ca528f6

View File

@ -114,9 +114,9 @@ def generateSvg(item, options={}):
for d in defs: for d in defs:
defsXml += d.toprettyxml(indent=' ') defsXml += d.toprettyxml(indent=' ')
defsXml += "</defs>\n" defsXml += "</defs>\n"
svgAttributes = f' viewBox ="0 0 {options["width"]} {options["height"]}"' svgAttributes = ' viewBox ="0 0 %f %f"' % (options["width"], options["height"])
c = options['background'] c = options['background']
backgroundtag = f'<rect width="100%" height="100%" style="fill:rgba({c.red()}, {c.blue()}, {c.green()}, {c.alpha()/255.0})" />\n' backgroundtag = '<rect width="100%%" height="100%%" style="fill:rgba(%f, %f, %f, %d)" />\n' % (c.red(), c.blue(), c.green(), c.alpha()/255.0)
return (xmlHeader % svgAttributes) + backgroundtag + defsXml + node.toprettyxml(indent=' ') + "\n</svg>\n" return (xmlHeader % svgAttributes) + backgroundtag + defsXml + node.toprettyxml(indent=' ') + "\n</svg>\n"