From: daid303 Date: Tue, 5 Mar 2013 12:43:27 +0000 (+0100) Subject: Small fix on the scrollbar to stop an division by zero. Which crashes the GUI thread. X-Git-Tag: 13.03~27 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=46b73b37e3536fce90b33c2ca50cb5123a7ff468;p=cura.git Small fix on the scrollbar to stop an division by zero. Which crashes the GUI thread. --- 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)