Fixed resetting to center of groups

Fixes #CURA-112
This commit is contained in:
Jaime van Kessel 2015-09-08 11:48:08 +02:00
parent ee513b0b83
commit 56e8b01f22

View File

@ -284,10 +284,10 @@ class CuraApplication(QtApplication):
@pyqtSlot("quint64") @pyqtSlot("quint64")
def centerObject(self, object_id): def centerObject(self, object_id):
node = self.getController().getScene().findObject(object_id) node = self.getController().getScene().findObject(object_id)
if node.getParent() and node.getParent().callDecoration("isGroup"):
node = node.getParent()
if not node and object_id != 0: #Workaround for tool handles overlapping the selected object if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
node = Selection.getSelectedObject(0) node = Selection.getSelectedObject(0)
if node: if node:
op = SetTransformOperation(node, Vector()) op = SetTransformOperation(node, Vector())
op.push() op.push()
@ -321,10 +321,9 @@ class CuraApplication(QtApplication):
continue #Grouped nodes don't need resetting as their parent (the group) is resetted) continue #Grouped nodes don't need resetting as their parent (the group) is resetted)
nodes.append(node) nodes.append(node)
print(nodes)
if nodes: if nodes:
op = GroupedOperation() op = GroupedOperation()
for node in nodes: for node in nodes:
op.addOperation(SetTransformOperation(node, Vector())) op.addOperation(SetTransformOperation(node, Vector()))