From 44233b4ebabfab3bfc49256dc55bca545030de49 Mon Sep 17 00:00:00 2001 From: Anton de Winter Date: Fri, 4 Mar 2022 10:01:44 -0800 Subject: [PATCH] Small bugfix for potential divide by zero error during sparkline drawing. --- cvui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cvui.py b/cvui.py index d98047d..98f68b7 100644 --- a/cvui.py +++ b/cvui.py @@ -991,7 +991,8 @@ def rect(self, theBlock, thePos, theBorderColor, theFillingColor): def sparkline(self, theBlock, theValues, theRect, theMin, theMax, theColor): aSize = len(theValues) i = 0 - aScale = theMax - theMin + delta = theMax - theMin + aScale = 1 if delta == 0 else delta aGap = float(theRect.width) / aSize aPosX = theRect.x