Skip to content

Commit

Permalink
needsExtraCell() results compare ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 5, 2024
1 parent 1649731 commit a76d745
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit a76d745

Please sign in to comment.