From be69ec5e005b423cbcddfeecd6963f404652bd76 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 29 Jun 2021 15:29:57 +0200 Subject: [PATCH] Draft: Fix mixup of TextAlignment vs Justification for Labels TextAlignment is the vertical alignment, while Justification is the horizontal alignment. here, get_text was passed the vertical, while it expected the horizontal. This caused the alignment of a Label to be wrong in the resulting SVG (e.g. in a TechDraw draft view). This seems to have been broken since SVG support for Labels was first introduced in commit 3391a5ea4b (Initial work, only text (no lines)). --- 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 5e53d217ab..dd5238e1fa 100644 --- a/src/Mod/Draft/draftfunctions/svg.py +++ b/src/Mod/Draft/draftfunctions/svg.py @@ -641,7 +641,7 @@ def get_svg(obj, fontname = obj.ViewObject.TextFont position = get_proj(obj.Placement.Base, plane) rotation = obj.Placement.Rotation - justification = obj.ViewObject.TextAlignment + justification = obj.ViewObject.Justification text = obj.Text svg += svgtext.get_text(plane, techdraw, stroke, fontsize, fontname,