Skip to content

Commit

Permalink
Comment explaining the local implementation of snapper mouse move
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert authored and yorikvanhavre committed Nov 1, 2017
1 parent 03ad4fb commit 2259102
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/Path/PathScripts/PathGetPoint.py
Expand Up @@ -104,8 +104,11 @@ def mouseMove(cb):
event = cb.getEvent()
pos = event.getPosition()
if self.onPath:
# There should not be a dependency from Draft->Path, so handle Path "snapping"
# directly, at least for now. Simple enough because there isn't really any
# "snapping" going on other than what getObjectInfo() provides.
screenpos = tuple(pos.getValue())
snapInfo = Draft.get3DView().getObjectInfo((screenpos[0],screenpos[1]))
snapInfo = Draft.get3DView().getObjectInfo(screenpos)
if snapInfo:
obj = FreeCAD.ActiveDocument.getObject(snapInfo['Object'])
if hasattr(obj, 'Path'):
Expand All @@ -114,6 +117,7 @@ def mouseMove(cb):
else:
self.obj = None
else:
# Snapper handles regular objects just fine
cntrl = event.wasCtrlDown()
shift = event.wasShiftDown()
self.pt = FreeCADGui.Snapper.snap(pos, lastpoint=start, active=cntrl, constrain=shift)
Expand Down

0 comments on commit 2259102

Please sign in to comment.