Bugfixes in Draft Snap

This commit is contained in:
Yorik van Havre 2012-02-02 18:01:17 -02:00
parent 26602b2aa3
commit 1af6a3c2b1
3 changed files with 19 additions and 18 deletions

View File

@ -100,7 +100,7 @@ class _CommandWall:
self.tracker = DraftTrackers.boxTracker()
FreeCADGui.Snapper.getPoint(callback=self.getPoint)
def getPoint(self,point,obj):
def getPoint(self,point=None,obj=None):
"this function is called by the snapper when it has a 3D point"
if obj:
if Draft.getType(obj) == "Wall":

View File

@ -851,6 +851,9 @@ class DraftToolBar:
numz=float(self.zValue.text())
except ValueError:
pass
else:
if self.pointcallback:
self.pointcallback(FreeCAD.Vector(numx,numy,numz),(self.isRelative.isVisible() and self.isRelative.isChecked()))
else:
if self.isRelative.isVisible() and self.isRelative.isChecked():
if self.sourceCmd.node:
@ -867,9 +870,6 @@ class DraftToolBar:
numx = v.x
numy = v.y
numz = v.z
if self.pointcallback:
self.pointcallback(FreeCAD.Vector(numx,numy,numz),self.isRelative.isChecked())
else:
self.sourceCmd.numericInput(numx,numy,numz)
def finish(self):

View File

@ -678,7 +678,8 @@ class Snapper:
def getcoords(point,relative=False):
self.pt = point
if relative and last:
self.pt = last.add(point)
v = FreeCAD.DraftWorkingPlane.getGlobalCoords(point)
self.pt = last.add(v)
accept()
def click(event_cb):