Skip to content

Commit 5309094

Browse files
committed
FIX in DisplayLineGraph, in case min==max it gives div by zero. Fixed scaling autocalculation.
1 parent 25acaab commit 5309094

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/lcd/lcd_comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def DisplayLineGraph(self, x: int, y: int, width: int, height: int,
420420

421421
step = width / len(values)
422422
# pre compute yScale multiplier value
423-
yScale = height / (max_value - min_value)
423+
yScale = (height / (max_value - min_value)) if (max_value - min_value) != 0 else 0
424424

425425
plotsX = []
426426
plotsY = []

0 commit comments

Comments
 (0)