From c114e375cc59b5842cca393766636e12d3bacc5c Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 17 Jun 2013 08:56:37 +0200 Subject: [PATCH] Do not render the focus objects if we do not have the mouse on the 3D window, increases performance a bit. --- Cura/gui/sceneView.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 184eb917..ba7d651e 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -106,6 +106,7 @@ class SceneView(openglGui.glGuiPanel): self._sceneUpdateTimer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self._onRunSlicer, self._sceneUpdateTimer) self.Bind(wx.EVT_MOUSEWHEEL, self.OnMouseWheel) + self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave) self.OnViewChange() self.OnToolSelect(0) @@ -683,6 +684,10 @@ class SceneView(openglGui.glGuiPanel): self._zoom = numpy.max(self._machineSize) * 3 self.Refresh() + def OnMouseLeave(self, e): + self._mouseX = -1 + self._focusObj = None + def getMouseRay(self, x, y): if self._viewport is None: return numpy.array([0,0,0],numpy.float32), numpy.array([0,0,1],numpy.float32) -- 2.30.2