Draft: Bugfix in snapping

This commit is contained in:
Yorik van Havre 2013-10-06 16:52:14 -03:00
parent 88493ec0e5
commit 01d5193296

View File

@ -324,16 +324,19 @@ class Snapper:
# calculating the nearest snap point
shortest = 1000000000000000000
origin = Vector(self.snapInfo['x'],self.snapInfo['y'],self.snapInfo['z'])
winner = [Vector(0,0,0),None,Vector(0,0,0)]
winner = None
fp = point
for snap in snaps:
if (not snap) or (snap[0] == None):
print "debug: Snapper: invalid snap point: ",snaps
pass
#print "debug: Snapper: invalid snap point: ",snaps
else:
delta = snap[0].sub(origin)
if delta.Length < shortest:
shortest = delta.Length
winner = snap
if winner:
# see if we are out of the max radius, if any
if self.radius:
dv = point.sub(winner[2])