Arch: Fixed flipped Space names

This commit is contained in:
Yorik van Havre 2015-11-16 16:11:32 -02:00
parent ba21766096
commit 58b41b9550
2 changed files with 6 additions and 4 deletions

View File

@ -324,9 +324,11 @@ class _ArchDrawingView:
svg = svg.replace('SWPlaceholder', str(linewidth*st) + 'px')
svg = svg.replace('DAPlaceholder', str(da))
if hasattr(self,"spaces"):
if round(self.direction.getAngle(FreeCAD.Vector(0,0,1)),Draft.precision()) in [0,round(math.pi,Draft.precision())]:
if self.spaces and round(self.direction.getAngle(FreeCAD.Vector(0,0,1)),Draft.precision()) in [0,round(math.pi,Draft.precision())]:
svg += '<g transform="scale(1,-1)">'
for s in self.spaces:
svg += Draft.getSVG(s,scale=obj.Scale,fontsize=obj.FontSize.Value,direction=self.direction)
svg += '</g>'
result = ''
result += '<g id="' + obj.Name + '"'
result += ' transform="'
@ -345,7 +347,7 @@ class _ArchDrawingView:
if hasattr(obj,"Source"):
if obj.Source:
if obj.Source.Objects:
objs = Draft.getGroupContents(obj.Source.Objects,walls=True)
objs = Draft.getGroupContents(obj.Source.Objects,walls=True,addgroups=True)
objs = Draft.removeHidden(objs)
# separate spaces
self.spaces = []

View File

@ -2120,9 +2120,9 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
p1 = p2.add(FreeCAD.Vector(obj.ViewObject.Proxy.header.translation.getValue().getValue()))
l = obj.ViewObject.LineSpacing/2.0
j = obj.ViewObject.TextAlign
svg += getText(c,f1,n,a,getProj(p1),t1,l,j,flip=False)
svg += getText(c,f1,n,a,getProj(p1),t1,l,j,flip=True)
if t2:
svg += getText(c,fontsize,n,a,getProj(p2),t2,l,j,flip=False)
svg += getText(c,fontsize,n,a,getProj(p2),t2,l,j,flip=True)
elif obj.isDerivedFrom('Part::Feature'):
if obj.Shape.isNull():