mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:19:04 +08:00
Fixed resetting to center of groups
Fixes #CURA-112
This commit is contained in:
parent
ee513b0b83
commit
56e8b01f22
@ -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()))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user