Draft: Fix SVG generation for label objects
Label objects would produce invalid SVG XML, because the stroke-linecap
property was added as if it was a style (with : and ;), but it was
inserted in the XML tag directly, rather than inside the style attribute
value. The invalid SVG prevented for example a TechDraw draft view from
rendering when it contained a label.
This was added in commit d8c74c06fd (Draft: Using square endcaps for
lines in SVG output).
This stroke-linecap is supported both as a presentation attribute inside
the style or a XML attribute, so for consistency with the surrounding
attributes, it is made a normal attribute, rather than putting it inside
the style.
See also https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap
This commit is contained in:
@@ -615,7 +615,7 @@ def get_svg(obj,
|
||||
svg_path += 'fill="none" '
|
||||
svg_path += 'stroke="{}" '.format(stroke)
|
||||
svg_path += 'stroke-width="{}" '.format(linewidth)
|
||||
svg_path += 'stroke-linecap:square;'
|
||||
svg_path += 'stroke-linecap="square" '
|
||||
svg_path += 'd="{}"'.format(path_dir_str)
|
||||
svg_path += '/>'
|
||||
svg += svg_path
|
||||
|
||||
Reference in New Issue
Block a user