Skip to content

Commit

Permalink
findTopCellItem() handle underflow (f6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 7, 2024
1 parent 30f1565 commit a7d19cd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ static uint8_t GraphMeterMode_findTopCellItem(const Meter* this, double scaledTo

// if (maxValue <= 0.0)
// if (topCellItem >= i)
if (topCellItem == i) {
break;
}
if (topCellItem > i) {
double topPoint = (valueSum / scaledTotal) * (double)(int)graphHeight;
assert(topPoint >= 0.0);
Expand Down

0 comments on commit a7d19cd

Please sign in to comment.