Skip to content

Commit

Permalink
topCell blanksAtStart bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Explorer09 committed Jan 28, 2024
1 parent 29c1560 commit 882c3df
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre

uint8_t blanksAtStart;
if (prev->nCellsPainted > 0) {
blanksAtStart = (uint8_t)maxBlanks % 8 - blanksAtEnd;
blanksAtStart = ((unsigned int)(uint8_t)maxBlanks - blanksAtEnd) % 8;
} else {
// Always zero blanks for the first cell.
// When an item would be painted with all cells (from the first cell to
Expand Down Expand Up @@ -773,8 +773,13 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co
}

// Paint cells to the buffer
if (hasPartialTopCell && prev.nItemsPainted == topCellItem)
rem = area - (int)area;
if (hasPartialTopCell && prev.nItemsPainted == topCellItem) {
rem = area;
if (nCells == 1 && rem > topCellArea) {
rem = topCellArea;
}
rem -= (int)rem;
}

if (nCells > 0 && new.nCellsPainted <= nCellsToPaint) {
double prevTopPoint = (prev.valueSum / scaledTotal) * (double)(int)graphHeight;
Expand Down

0 comments on commit 882c3df

Please sign in to comment.