Skip to content

Commit

Permalink
makeDetailsMask() blanksAtEnd (q21f)
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 16, 2024
1 parent 8c43d9e commit b08386d
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 @@ -531,10 +531,11 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre
if ((uint8_t)numDots % 2 == 0) {
distance -= 0.5;
}

distance = ceil(distance);
unsigned int maxBlanks2 = 8 - (unsigned int)(int)numDots / 2;
maxBlanks2 = MAXIMUM(maxBlanks2, (unsigned int)(int32_t)distance);
blanksAtEnd = (uint8_t)(maxBlanks2 - (unsigned int)(int32_t)distance);
double temp1 = MINIMUM((double)(int)maxBlanks2, distance);
blanksAtEnd = (uint8_t)(maxBlanks2 - (unsigned int)(int)temp1);
}
assert(blanksAtEnd < 8);

Expand Down

0 comments on commit b08386d

Please sign in to comment.