From f62d0c46378a7db367892f07fd4dae657cf1b63b Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 29 Jun 2021 15:24:03 +0200 Subject: [PATCH] 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 6a7912d399 (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 --- src/Mod/Draft/draftfunctions/svg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftfunctions/svg.py b/src/Mod/Draft/draftfunctions/svg.py index ba34655dfd..5e53d217ab 100644 --- a/src/Mod/Draft/draftfunctions/svg.py +++ b/src/Mod/Draft/draftfunctions/svg.py @@ -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