From 2e5fbb0f88eb9ffd88b50350a02663d09c41b524 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sat, 10 Feb 2024 18:31:29 +0800 Subject: [PATCH] makeDetailsMask() maxBlanks uint8_t (q14) --- Meter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Meter.c b/Meter.c index bd5b65050..29e41710c 100644 --- a/Meter.c +++ b/Meter.c @@ -504,7 +504,6 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre assert(rem < 1.0); double numDots = ceil(rem * 8.0); - double maxBlanks = 8.0 - numDots; uint8_t blanksAtEnd; bool roundsUpInAscii = false; @@ -514,7 +513,7 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre blanksAtEnd = (uint8_t)blanksAtTopCell; roundsUpInAscii = true; } else if (prev->nCellsPainted == 0 || prevTopPoint <= (double)(int)prev->nCellsPainted) { - blanksAtEnd = (uint8_t)maxBlanks % 8; + blanksAtEnd = (uint8_t)(8 - (uint8_t)numDots) % 8; } else { // Unlike other conditions, this one rounds to nearest for visual reason. // In case of a tie, display the dot at lower position of the graph, @@ -539,7 +538,7 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre uint8_t blanksAtStart; if (prev->nCellsPainted > 0) { - blanksAtStart = (uint8_t)((int)maxBlanks - blanksAtEnd) % 8; + blanksAtStart = (uint8_t)(8 - (uint8_t)numDots - blanksAtEnd) % 8; } else { // Always zero blanks for the first cell. // When an item would be painted with all cells (from the first cell to