Insert dressups at the same position in the operations list as the parent op is/was

This commit is contained in:
Markus Lampert
2018-11-03 15:39:26 -07:00
committed by Yorik van Havre
parent de5b785f6e
commit bfcd21361f
7 changed files with 31 additions and 16 deletions

View File

@@ -331,10 +331,17 @@ class ObjectJob:
def execute(self, obj):
obj.Path = obj.Operations.Path
def addOperation(self, op):
def addOperation(self, op, before = None):
group = self.obj.Operations.Group
if op not in group:
group.append(op)
if before:
try:
group.insert(group.index(before), op)
except Exception as e:
PathLog.error(e)
group.append(op)
else:
group.append(op)
self.obj.Operations.Group = group
op.Path.Center = self.obj.Operations.Path.Center