Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad

This commit is contained in:
wmayer 2012-11-24 21:22:30 +01:00
commit ba059b8140
2 changed files with 10 additions and 7 deletions

View File

@ -1381,6 +1381,7 @@ class Dimension(Creator):
self.arcmode = False
self.point2 = None
self.force = None
self.info = None
msg(translate("draft", "Pick first point:\n"))
FreeCADGui.draftToolBar.show()
@ -1451,9 +1452,9 @@ class Dimension(Creator):
self.finish()
elif arg["Type"] == "SoLocation2Event": #mouse movement detection
shift = hasMod(arg,MODCONSTRAIN)
self.point,ctrlPoint,self.info = getPoint(self,arg)
if self.arcmode or self.point2:
setMod(arg,MODCONSTRAIN,False)
self.point,ctrlPoint,info = getPoint(self,arg)
if hasMod(arg,MODALT) and (len(self.node)<3):
self.dimtrack.off()
if not self.altdown:
@ -1534,11 +1535,11 @@ class Dimension(Creator):
if (not self.node) and (not self.support):
self.support = getSupport(arg)
if hasMod(arg,MODALT) and (len(self.node)<3):
print "snapped: ",info
if info:
ob = self.doc.getObject(info['Object'])
if 'Edge' in info['Component']:
num = int(info['Component'].lstrip('Edge'))-1
print "snapped: ",self.info
if self.info:
ob = self.doc.getObject(self.info['Object'])
if 'Edge' in self.info['Component']:
num = int(self.info['Component'].lstrip('Edge'))-1
ed = ob.Shape.Edges[num]
v1 = ed.Vertexes[0].Point
v2 = ed.Vertexes[-1].Point

View File

@ -235,7 +235,9 @@ class dimTracker(Tracker):
self.p1 = self.p2 = self.p3 = None
def update(self,pts):
if len(pts) == 1:
if not pts:
return
elif len(pts) == 1:
self.p3 = pts[0]
else:
self.p1 = pts[0]