diff --git a/Meter.c b/Meter.c index 9cefa55f4..19a6c0872 100644 --- a/Meter.c +++ b/Meter.c @@ -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; }