From 69452e3a1f7c7e6971c85b16201ed32e7aec88ea Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sun, 28 Jan 2024 05:40:03 +0800 Subject: [PATCH] findTopCellItem() optimization --- Meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meter.c b/Meter.c index 87457ab5f..e733e43a0 100644 --- a/Meter.c +++ b/Meter.c @@ -400,7 +400,7 @@ static uint8_t GraphMeterMode_findTopCellItem(const Meter* this, double scaledTo double topPoint = (valueSum / scaledTotal) * (double)(int)graphHeight; double area = (value / scaledTotal) * (double)(int)graphHeight; - if (topPoint - (double)(int)topCell > 0.0) { + if (topPoint > (double)(int)topCell) { if (area > topPoint - (double)(int)topCell) area = topPoint - (double)(int)topCell;