Arch: Fixed toolbar mode - fixes #1473

This commit is contained in:
Yorik van Havre
2014-03-27 17:18:14 -03:00
parent ebb921d60a
commit e429b31acb
3 changed files with 30 additions and 21 deletions

View File

@@ -481,11 +481,12 @@ class _CommandStructure:
def update(self,point,info):
"this function is called by the Snapper when the mouse is moved"
if self.Height >= self.Length:
delta = Vector(0,0,self.Height/2)
else:
delta = Vector(self.Length/2,0,0)
self.tracker.pos(point.add(delta))
if FreeCADGui.Control.activeDialog():
if self.Height >= self.Length:
delta = Vector(0,0,self.Height/2)
else:
delta = Vector(self.Length/2,0,0)
self.tracker.pos(point.add(delta))
def setWidth(self,d):
self.Width = d

View File

@@ -246,20 +246,21 @@ class _CommandWall:
def update(self,point,info):
"this function is called by the Snapper when the mouse is moved"
b = self.points[0]
n = FreeCAD.DraftWorkingPlane.axis
bv = point.sub(b)
dv = bv.cross(n)
dv = DraftVecUtils.scaleTo(dv,self.Width/2)
if self.Align == "Center":
self.tracker.update([b,point])
elif self.Align == "Left":
self.tracker.update([b.add(dv),point.add(dv)])
else:
dv = dv.negative()
self.tracker.update([b.add(dv),point.add(dv)])
if self.Length:
self.Length.setValue(bv.Length)
if FreeCADGui.Control.activeDialog():
b = self.points[0]
n = FreeCAD.DraftWorkingPlane.axis
bv = point.sub(b)
dv = bv.cross(n)
dv = DraftVecUtils.scaleTo(dv,self.Width/2)
if self.Align == "Center":
self.tracker.update([b,point])
elif self.Align == "Left":
self.tracker.update([b.add(dv),point.add(dv)])
else:
dv = dv.negative()
self.tracker.update([b.add(dv),point.add(dv)])
if self.Length:
self.Length.setValue(bv.Length)
def taskbox(self):
"sets up a taskbox widget"