mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 11:45:55 +08:00
Deley center_on_selection cameraAnimation until mouse release
This commit is contained in:
parent
40bfd32f06
commit
7b09bb0c9e
@ -22,6 +22,7 @@ from UM.Message import Message
|
|||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
from UM.JobQueue import JobQueue
|
from UM.JobQueue import JobQueue
|
||||||
from UM.Math.Polygon import Polygon
|
from UM.Math.Polygon import Polygon
|
||||||
|
from UM.Event import MouseEvent
|
||||||
|
|
||||||
from UM.Scene.BoxRenderer import BoxRenderer
|
from UM.Scene.BoxRenderer import BoxRenderer
|
||||||
from UM.Scene.Selection import Selection
|
from UM.Scene.Selection import Selection
|
||||||
@ -231,9 +232,9 @@ class CuraApplication(QtApplication):
|
|||||||
else:
|
else:
|
||||||
self.getController().setActiveTool("TranslateTool")
|
self.getController().setActiveTool("TranslateTool")
|
||||||
if Preferences.getInstance().getValue("view/center_on_select"):
|
if Preferences.getInstance().getValue("view/center_on_select"):
|
||||||
self._camera_animation.setStart(self.getController().getTool("CameraTool").getOrigin())
|
print("connect")
|
||||||
self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition())
|
print(self.getController().getInputDevice("qt_mouse").event)
|
||||||
self._camera_animation.start()
|
self.getController().getInputDevice("qt_mouse").event.connect(self.onMouseEventAfterSelectionChanged)
|
||||||
else:
|
else:
|
||||||
if self.getController().getActiveTool():
|
if self.getController().getActiveTool():
|
||||||
self._previous_active_tool = self.getController().getActiveTool().getPluginId()
|
self._previous_active_tool = self.getController().getActiveTool().getPluginId()
|
||||||
@ -241,6 +242,15 @@ class CuraApplication(QtApplication):
|
|||||||
else:
|
else:
|
||||||
self._previous_active_tool = None
|
self._previous_active_tool = None
|
||||||
|
|
||||||
|
def onMouseEventAfterSelectionChanged(self, event):
|
||||||
|
print("event")
|
||||||
|
if event.type == MouseEvent.MouseReleaseEvent:
|
||||||
|
print("disconnect")
|
||||||
|
self.getController().getInputDevice("qt_mouse").event.disconnect(self.onMouseEventAfterSelectionChanged)
|
||||||
|
self._camera_animation.setStart(self.getController().getTool("CameraTool").getOrigin())
|
||||||
|
self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition())
|
||||||
|
self._camera_animation.start()
|
||||||
|
|
||||||
requestAddPrinter = pyqtSignal()
|
requestAddPrinter = pyqtSignal()
|
||||||
activityChanged = pyqtSignal()
|
activityChanged = pyqtSignal()
|
||||||
sceneBoundingBoxChanged = pyqtSignal()
|
sceneBoundingBoxChanged = pyqtSignal()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user