From: daid Date: Mon, 17 Jun 2013 06:56:37 +0000 (+0200) Subject: Do not render the focus objects if we do not have the mouse on the 3D window, increas... X-Git-Tag: 13.06.2~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c114e375cc59b5842cca393766636e12d3bacc5c;p=cura.git Do not render the focus objects if we do not have the mouse on the 3D window, increases performance a bit. --- 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)