Draft: fixes in offset

This commit is contained in:
Yorik van Havre 2014-03-29 19:39:11 -03:00
parent 0087cfeccb
commit fabe39b976
2 changed files with 6 additions and 4 deletions

View File

@ -1388,9 +1388,9 @@ def offset(obj,delta,copy=False,bind=False,sym=False,occ=False):
bh = p[3].sub(p[0])
nb = DraftVecUtils.project(diag,bb)
nh = DraftVecUtils.project(diag,bh)
if obj.Length < 0: l = -nb.Length
if obj.Length.Value < 0: l = -nb.Length
else: l = nb.Length
if obj.Height < 0: h = -nh.Length
if obj.Height.Value < 0: h = -nh.Length
else: h = nh.Length
return l,h,pl

View File

@ -2507,7 +2507,8 @@ class Offset(Modifier):
d = DraftVecUtils.toString(self.dvec)
self.commit(translate("draft","Offset"),
['import Draft',
'Draft.offset(FreeCAD.ActiveDocument.'+self.sel.Name+','+d+',copy='+str(copymode)+',occ='+str(occmode)+')'])
'Draft.offset(FreeCAD.ActiveDocument.'+self.sel.Name+','+d+',copy='+str(copymode)+',occ='+str(occmode)+')',
'FreeCAD.ActiveDocument.recompute()'])
if hasMod(arg,MODALT):
self.extendedCopy = True
else:
@ -2536,7 +2537,8 @@ class Offset(Modifier):
d = DraftVecUtils.toString(self.dvec)
self.commit(translate("draft","Offset"),
['import Draft',
'Draft.offset(FreeCAD.ActiveDocument.'+self.sel.Name+','+d+',copy='+str(copymode)+',occ='+str(occmode)+')'])
'Draft.offset(FreeCAD.ActiveDocument.'+self.sel.Name+','+d+',copy='+str(copymode)+',occ='+str(occmode)+')',
'FreeCAD.ActiveDocument.recompute()'])
self.finish()