Skip to content

Commit

Permalink
Draft: Objects drawn on an existing face will no longer take it as su…
Browse files Browse the repository at this point in the history
…pport unless the face was already selected
  • Loading branch information
yorikvanhavre committed Aug 17, 2014
1 parent 75fa3d4 commit 14292c1
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/Mod/Draft/DraftTools.py
Expand Up @@ -173,10 +173,8 @@ def getSupport(args=None):
self.display(plane.axis)
except:
pass
if obj.isDerivedFrom("Part::Part2DObject"):
# make sure we don't set another Draft object as support
return None
return obj
# don't set the object's support if we are in the middle of an operation
return None

def hasMod(args,mod):
"checks if args has a specific modifier"
Expand Down Expand Up @@ -259,8 +257,7 @@ def finish(self,close=False):
msg("")
if self.planetrack:
self.planetrack.finalize()
if self.support:
plane.restore()
plane.restore()
if hasattr(FreeCADGui,"Snapper"):
FreeCADGui.Snapper.off()
if self.call:
Expand Down Expand Up @@ -497,7 +494,8 @@ def action(self,arg):
self.finish(False,cont=True)
else:
if (not self.node) and (not self.support):
self.support = getSupport(arg)
getSupport(arg)
self.point,ctrlPoint,info = getPoint(self,arg)
if self.point:
self.ui.redraw()
self.pos = arg["Position"]
Expand Down Expand Up @@ -612,7 +610,8 @@ def action(self,arg):
self.finish(False,cont=True)
else:
if (not self.node) and (not self.support):
self.support = getSupport(arg)
getSupport(arg)
self.point,ctrlPoint,info = getPoint(self,arg,noTracker=True)
if self.point:
self.ui.redraw()
self.pos = arg["Position"]
Expand Down Expand Up @@ -708,7 +707,8 @@ def action(self,arg):
self.finish(False,cont=True)
else:
if (not self.node) and (not self.support): #first point
self.support = getSupport(arg)
getSupport(arg)
self.point,ctrlPoint,info = getPoint(self,arg,noTracker=True)
if self.point:
self.ui.redraw()
self.pos = arg["Position"]
Expand Down Expand Up @@ -925,7 +925,8 @@ def action(self,arg):
self.finish()
else:
if (not self.node) and (not self.support):
self.support = getSupport(arg)
getSupport(arg)
self.point,ctrlPoint,info = getPoint(self,arg,mobile=True,noTracker=True)
if self.point:
self.ui.redraw()
self.appendPoint(self.point)
Expand Down Expand Up @@ -1091,7 +1092,8 @@ def action(self,arg):
if self.point:
if (self.step == 0): # choose center
if not self.support:
self.support = getSupport(arg)
getSupport(arg)
self.point,ctrlPoint,info = getPoint(self,arg)
if hasMod(arg,MODALT):
snapped=self.view.getObjectInfo((arg["Position"][0],arg["Position"][1]))
if snapped:
Expand Down Expand Up @@ -1360,7 +1362,8 @@ def action(self,arg):
if self.point:
if (self.step == 0): # choose center
if (not self.node) and (not self.support):
self.support = getSupport(arg)
getSupport(arg)
self.point,ctrlPoint,info = getPoint(self,arg)
if hasMod(arg,MODALT):
snapped=self.view.getObjectInfo((arg["Position"][0],arg["Position"][1]))
if snapped:
Expand Down Expand Up @@ -1532,7 +1535,8 @@ def action(self,arg):
self.finish()
else:
if (not self.node) and (not self.support):
self.support = getSupport(arg)
getSupport(arg)
self.point,ctrlPoint,info = getPoint(self,arg,mobile=True,noTracker=True)
if self.point:
self.ui.redraw()
self.appendPoint(self.point)
Expand Down Expand Up @@ -1832,7 +1836,7 @@ def action(self,arg):
if self.point:
self.ui.redraw()
if (not self.node) and (not self.support):
self.support = getSupport(arg)
getSupport(arg)
if hasMod(arg,MODALT) and (len(self.node)<3):
#print "snapped: ",self.info
if self.info:
Expand Down

0 comments on commit 14292c1

Please sign in to comment.