Skip to content

Commit

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

unsigned int numDots = (unsigned int)(int) ceil(rem * 8.0);
unsigned int numDotsNeg = -numDots;

uint8_t blanksAtEnd;
bool roundsUpInAscii = false;
Expand All @@ -513,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 = (8 - numDots) % 8;
blanksAtEnd = (8 + numDotsNeg) % 8;
} else if ((double)(int)new->nCellsPainted > new->topPoint) {
assert(new->nCellsPainted - new->topPoint < 1.0);
assert(rem > 0.0);
Expand Down Expand Up @@ -548,7 +549,7 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre

uint8_t blanksAtStart;
if (prev->nCellsPainted > 0) {
blanksAtStart = (8 - numDots - blanksAtEnd) % 8;
blanksAtStart = (8 + numDotsNeg - blanksAtEnd) % 8;
} else {
// Always zero blanks for the first cell.
// When an item would be painted with all cells (from the first cell to
Expand Down

0 comments on commit 090219c

Please sign in to comment.