From 46b73b37e3536fce90b33c2ca50cb5123a7ff468 Mon Sep 17 00:00:00 2001 From: daid303 Date: Tue, 5 Mar 2013 13:43:27 +0100 Subject: [PATCH] Small fix on the scrollbar to stop an division by zero. Which crashes the GUI thread. --- Cura/gui/util/openglGui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cura/gui/util/openglGui.py b/Cura/gui/util/openglGui.py index 023e794d..408c026e 100644 --- a/Cura/gui/util/openglGui.py +++ b/Cura/gui/util/openglGui.py @@ -849,7 +849,8 @@ class glSlider(glGuiControl): opengl.glDrawStringRight(str(self._minValue)) glTranslate(0,-scrollLength,0) opengl.glDrawStringRight(str(self._maxValue)) - glTranslate(w,scrollLength-scrollLength*((self._value-self._minValue)/(self._maxValue-self._minValue)),0) + if self._maxValue-self._minValue > 0: + glTranslate(w,scrollLength-scrollLength*((self._value-self._minValue)/(self._maxValue-self._minValue)),0) opengl.glDrawStringLeft(str(self._value)) glPopMatrix() glColor4ub(255,255,255,240) -- 2.30.2