diff --git a/Meter.c b/Meter.c index 2727a18b3..c5abdefd8 100644 --- a/Meter.c +++ b/Meter.c @@ -735,27 +735,18 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co if (adjLarge.nCells > adjSmall.nCells) { int res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjLarge); - if (res == 1) { + if (res > 0 || (res < 0 && rItemMinCells <= nCells)) { rItemHasExtraCell = true; break; } - if (res == -1) { - if (rItemMinCells <= nCells) { - rItemHasExtraCell = true; - break; - } - } } if (rItemHasExtraCell) { int res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjSmall); - if (res == 0) { + if (res == 0 || (res < 0 && rItemMinCells > nCells)) { rItemHasExtraCell = false; - } else if (res == -1) { - if (rItemMinCells > nCells) { - rItemHasExtraCell = false; - } + // Do not break the loop here } } }