Disable slicing and platform physics when an operation is being performed

This prevents the model from jumping around during rotation/scale

Fixes #56
This commit is contained in:
Arjen Hiemstra 2015-06-22 17:23:32 +02:00
parent bc055a8031
commit 72b1302f9e
2 changed files with 26 additions and 0 deletions

View file

@ -59,6 +59,8 @@ class CuraEngineBackend(Backend):
self._save_polygons = True
self._report_progress = True
self._enabled = True
self.backendConnected.connect(self._onBackendConnected)
def getEngineCommand(self):
@ -86,6 +88,9 @@ class CuraEngineBackend(Backend):
# If False, this method will do nothing when already slicing. True by default.
# - report_progress: True if the slicing progress should be reported, False if not. Default is True.
def slice(self, **kwargs):
if not self._enabled:
return
if self._slicing:
if not kwargs.get("force_restart", True):
return
@ -235,3 +240,10 @@ class CuraEngineBackend(Backend):
if self._restart:
self._onChanged()
self._restart = False
def _onToolOperationStarted(self, tool):
self._enabled = False
def _onToolOperationStopped(self, tool):
self._enabled = True
self._onChanged()