mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Fix undo of PlatformPhysicsOperation after the SceneNode changes
This commit is contained in:
parent
a8ca621051
commit
d1ed5a7a8a
1 changed files with 4 additions and 4 deletions
|
@ -8,15 +8,15 @@ class PlatformPhysicsOperation(Operation):
|
||||||
def __init__(self, node, translation):
|
def __init__(self, node, translation):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._node = node
|
self._node = node
|
||||||
self._transform = node.getLocalTransformation()
|
self._old_position = node.getPosition()
|
||||||
self._position = node.getPosition() + translation
|
self._new_position = node.getPosition() + translation
|
||||||
self._always_merge = True
|
self._always_merge = True
|
||||||
|
|
||||||
def undo(self):
|
def undo(self):
|
||||||
self._node.setLocalTransformation(self._transform)
|
self._node.setPosition(self._old_position)
|
||||||
|
|
||||||
def redo(self):
|
def redo(self):
|
||||||
self._node.setPosition(self._position)
|
self._node.setPosition(self._new_position)
|
||||||
|
|
||||||
def mergeWith(self, other):
|
def mergeWith(self, other):
|
||||||
group = GroupedOperation()
|
group = GroupedOperation()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue