Skip to content

Commit

Permalink
needsExtraCell() int8_t type
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Feb 22, 2024
1 parent 73e112c commit a22c188
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static uint8_t GraphMeterMode_findTopCellItem(const Meter* this, double scaledTo
return topCellItem;
}

static int GraphMeterMode_needsExtraCell(unsigned int graphHeight, double scaledTotal, unsigned int y, const GraphColorAdjStack* stack, const GraphColorAdjOffset* adjOffset) {
static int8_t GraphMeterMode_needsExtraCell(unsigned int graphHeight, double scaledTotal, unsigned int y, const GraphColorAdjStack* stack, const GraphColorAdjOffset* adjOffset) {
double areaSum = (stack->fractionSum + stack->valueSum / scaledTotal) * (double)(int)graphHeight;
double adjOffsetVal = adjOffset ? (double)(int32_t)adjOffset->offsetVal : 0.0;
double halfPoint = (double)(int)y + 0.5;
Expand Down Expand Up @@ -770,7 +770,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co
unsigned int y = restart.nCellsPainted + rItemMinCells;

if (adjLarge.nCells > adjSmall.nCells) {
int res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjLarge);
int8_t res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjLarge);

if (res > 0 || (res < 0 && rItemMinCells <= nCells)) {
rItemHasExtraCell = true;
Expand All @@ -779,7 +779,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co
}

if (rItemHasExtraCell) {
int res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjSmall);
int8_t res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjSmall);

if (res == 0 || (res < 0 && rItemMinCells > nCells)) {
rItemHasExtraCell = false;
Expand Down

0 comments on commit a22c188

Please sign in to comment.