Skip to content

Commit

Permalink
interpolation code (e2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 5, 2024
1 parent e95b810 commit a9b1674
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 @@ -817,7 +817,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co
if (hasThresholdRange && nCellsPaintedLow < nCellsPaintedHigh) {
// Linear interpolation
assert(nCellsPaintedLow <= nCellsToPaint);
threshold -= ((thresholdHigh - thresholdLow) * (nCellsToPaint - nCellsPaintedLow) / (double)(int)(nCellsPaintedHigh - nCellsPaintedLow));
threshold -= ((thresholdHigh - thresholdLow) * (double)(int)(nCellsToPaint - nCellsPaintedLow) / (double)(int)(nCellsPaintedHigh - nCellsPaintedLow));
if (threshold < nextThresholdLow) {
threshold = nextThresholdLow;
}
Expand Down

0 comments on commit a9b1674

Please sign in to comment.