Skip to content

Commit

Permalink
makeDetailsMask() maxBlanks uint8_t (p7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 12, 2024
1 parent 1f4ea10 commit d2e06b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre
assert(rem < 1.0);

double numDots = ceil(rem * 8.0);
uint8_t maxBlanks = 8 - (uint8_t)numDots;
uint8_t maxBlanks = (uint8_t)(8 - (uint8_t)numDots) % 8;

uint8_t blanksAtEnd;
bool roundsUpInAscii = false;
Expand All @@ -514,7 +514,7 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre
blanksAtEnd = (uint8_t)blanksAtTopCell;
roundsUpInAscii = true;
} else if (prev->nCellsPainted == 0 || prev->topPoint <= (double)(int)prev->nCellsPainted) {
blanksAtEnd = maxBlanks % 8;
blanksAtEnd = maxBlanks;
} else if ((double)(int)new->nCellsPainted > new->topPoint) {
assert((int)new->nCellsPainted - new->topPoint < 1.0);
// Unlike other conditions, this one rounds to nearest for visual reason.
Expand Down

0 comments on commit d2e06b7

Please sign in to comment.