From: Erik de Bruijn Date: Tue, 16 Apr 2013 15:08:30 +0000 (+0200) Subject: Limited the amount of zooming during scrolling to a more sane value. X-Git-Tag: 13.05~92 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=84a2cf881ba318d402d2d83abfe27839a67d3a46;p=cura.git Limited the amount of zooming during scrolling to a more sane value. --- diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 1bf2c810..f12b43b1 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -457,7 +457,9 @@ class SceneView(openglGui.glGuiPanel): self._mouseY = e.GetY() def OnMouseWheel(self, e): - self._zoom *= 1.0 - float(e.GetWheelRotation() / e.GetWheelDelta()) / 10.0 + delta = float(e.GetWheelRotation()) / float(e.GetWheelDelta()) + delta = max(min(delta,4),-4) + self._zoom *= 1.0 - delta / 10.0 if self._zoom < 1.0: self._zoom = 1.0 if self._zoom > numpy.max(self._machineSize) * 3: