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:
Arjen Hiemstra 2015-06-23 14:56:51 +02:00
parent ab9f30a852
commit 3faccd5b3e

View file

@ -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()