Skip to content

Commit

Permalink
makeDetailsMask() blanksAtEnd floats (q15a)
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 13, 2024
1 parent 2e5fbb0 commit 28ad821
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,13 +526,10 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre
roundsUpInAscii = distance > 0.5;
roundsDownInAscii = distance < 0.5;

double fraction = (uint8_t)numDots % 2 > 0 ? 0.5 : 0.0;
double fraction = numDots * 0.5;
fraction -= (int)fraction;
distance = ceil(distance * 8.0 - fraction);
if (8.0 - distance - (uint8_t)numDots / 2 > 0) {
blanksAtEnd = 8.0 - distance - (uint8_t)numDots / 2;
} else {
blanksAtEnd = 0;
}
blanksAtEnd = (uint8_t)MAXIMUM(8.0 - distance - (double)(int)(numDots * 0.5), 0.0);
}
assert(blanksAtEnd < 8);

Expand Down

0 comments on commit 28ad821

Please sign in to comment.