Skip to content

Commit

Permalink
"threshold" code add int cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 22, 2024
1 parent 80da414 commit 6c019fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co
if (hasThresholdRange && nCellsPaintedLow < nCellsPaintedHigh) {
// Linear interpolation
assert(nCellsPaintedLow <= nCellsToPaint);
threshold -= ((thresholdHigh - thresholdLow) * (nCellsToPaint - nCellsPaintedLow) / (nCellsPaintedHigh - nCellsPaintedLow));
threshold -= ((thresholdHigh - thresholdLow) * (double)(int)(nCellsToPaint - nCellsPaintedLow) / (double)(int)(nCellsPaintedHigh - nCellsPaintedLow));
if (threshold < nextThresholdLow) {
threshold = nextThresholdLow;
}
Expand Down

0 comments on commit 6c019fe

Please sign in to comment.