From 3ce0de62f1dccfc214f919b9bc540a2c1f9e5f36 Mon Sep 17 00:00:00 2001 From: WandererFan Date: Wed, 16 Nov 2016 20:59:33 -0500 Subject: [PATCH] Fix #2771 handling of PropertyLinkSubList in Draft.PathArray --- src/Mod/Draft/Draft.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index ef1c969fb..f9f7bc5c9 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -1736,7 +1736,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct with the given linewidth and fontsize (used if the given object contains any text). You can also supply an arbitrary projection vector. the scale parameter allows to scale linewidths down, so they are resolution-independant.''' - + # if this is a group, gather all the svg views of its children if hasattr(obj,"isDerivedFrom"): if obj.isDerivedFrom("App::DocumentObjectGroup"): @@ -1744,7 +1744,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct for child in obj.Group: svg += getSVG(child,scale,linewidth,fontsize,fillstyle,direction,linestyle,color,linespacing,techdraw) return svg - + import Part, DraftGeomUtils pathdata = [] svg = "" @@ -1811,7 +1811,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct if techdraw: ly = -ly return Vector(lx,ly,0) - + def getDiscretized(edge): ml = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetFloat("svgDiscretization",10.0) d = int(edge.Length/ml) @@ -1944,7 +1944,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct for linepoint in bspline.discretize(0.1)[1:]: v = getProj(linepoint) edata += 'L '+ str(v.x) +' '+ str(v.y) + ' ' - if fill != 'none': + if fill != 'none': edata += 'Z ' if edata in pathdata: # do not draw a path on another identical path @@ -2069,7 +2069,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct svg += 'translate(' + str(base.x) + ',' + str(base.y+linespacing*i) + ')" ' #svg += '" freecad:skip="1"' svg += '>\n' + t + '\n' - else: + else: svg = '