Skip to content

Commit

Permalink
[Draft] Edit by default one object at once
Browse files Browse the repository at this point in the history
Small optimization and set max number of edited objects to 1
  • Loading branch information
carlopav authored and yorikvanhavre committed Sep 2, 2019
1 parent 0dbd120 commit b08dc74
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Mod/Draft/DraftEdit.py
Expand Up @@ -50,6 +50,7 @@ def __init__(self):
self.running = False
self.trackers = {'object':[]}
self.obj = None
self.editing = None

# event callbacks
self.call = None
Expand All @@ -63,7 +64,7 @@ def __init__(self):
self.originalNodes = None

# settings
self.maxObjects = 5
self.maxObjects = 1
self.pick_radius = 30 # TODO: set pick radius according to user preferences

# preview
Expand Down Expand Up @@ -116,9 +117,6 @@ def proceed(self):

# start object editing
FreeCADGui.Selection.clearSelection()
self.editing = None
self.editpoints = []

FreeCADGui.Snapper.setSelectMode(True)

self.arc3Pt = True # TODO: Find a more elegant way
Expand Down Expand Up @@ -226,7 +224,6 @@ def keyPressed(self, event_callback):
if self.editing == None: self.finish()
else:
self.finalizeGhost()
self.editpoints = []
self.setEditPoints(self.obj)
self.resetTrackers()
if key == 97: # "a"
Expand Down Expand Up @@ -585,7 +582,6 @@ def addPoint(self,event):
else: continue
self.addPointToCurve(pt,info)
self.obj.recompute()
self.editpoints = []
self.removeTrackers(self.obj)
self.setEditPoints(self.obj)
#self.setSelectState(self.obj, False)
Expand Down Expand Up @@ -678,7 +674,6 @@ def delPoint(self,event):
self.obj.recompute()

# don't do tan/sym on DWire/BSpline!
self.editpoints = []
self.removeTrackers(self.obj)
self.setEditPoints(self.obj)

Expand All @@ -688,7 +683,7 @@ def delPoint(self,event):

def setEditPoints(self,obj):
"append given object's editpoints to self.edipoints and set EditTrackers"

self.editpoints = []
self.setPlacement(obj)

objectType = Draft.getType(obj)
Expand Down

0 comments on commit b08dc74

Please sign in to comment.