mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
If findObject returns none but object_id != 0 use the selected object
This works around an issue where the tool handles overlap the selected object and thus context menu entries would not work. Fixes #64
This commit is contained in:
parent
ab9f30a852
commit
3faccd5b3e
1 changed files with 9 additions and 0 deletions
|
@ -215,6 +215,9 @@ class CuraApplication(QtApplication):
|
|||
def deleteObject(self, object_id):
|
||||
object = self.getController().getScene().findObject(object_id)
|
||||
|
||||
if not object and object_id != 0: #Workaround for tool handles overlapping the selected object
|
||||
object = Selection.getSelectedObject(0)
|
||||
|
||||
if object:
|
||||
op = RemoveSceneNodeOperation(object)
|
||||
op.push()
|
||||
|
@ -224,6 +227,9 @@ class CuraApplication(QtApplication):
|
|||
def multiplyObject(self, object_id, count):
|
||||
node = self.getController().getScene().findObject(object_id)
|
||||
|
||||
if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
|
||||
node = Selection.getSelectedObject(0)
|
||||
|
||||
if node:
|
||||
op = GroupedOperation()
|
||||
for i in range(count):
|
||||
|
@ -240,6 +246,9 @@ class CuraApplication(QtApplication):
|
|||
def centerObject(self, object_id):
|
||||
node = self.getController().getScene().findObject(object_id)
|
||||
|
||||
if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
|
||||
node = Selection.getSelectedObject(0)
|
||||
|
||||
if node:
|
||||
op = SetTransformOperation(node, Vector())
|
||||
op.push()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue