chiark / gitweb /
Limited the amount of zooming during scrolling to a more sane value.
authorErik de Bruijn <github@erikdebruijn.nl>
Tue, 16 Apr 2013 15:08:30 +0000 (17:08 +0200)
committerErik de Bruijn <github@erikdebruijn.nl>
Tue, 16 Apr 2013 15:08:30 +0000 (17:08 +0200)
Cura/gui/sceneView.py

index 1bf2c81044c31c220fbf19816a90bfbfdb102322..f12b43b18356869186fce3a99da829e6b6a394f4 100644 (file)
@@ -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: