Skip to content

Commit

Permalink
Fixed arc regression
Browse files Browse the repository at this point in the history
Signed-off-by: simonmicro <[email protected]>
  • Loading branch information
simonmicro committed Aug 11, 2024
1 parent 9f84c4a commit 8000970
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/widgets/OswProgressWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ void OswProgressWidget::drawCircular(Graphics2DPrint* gfx, int x, int y, float s
arcStart = 0;
arcLength = value * 360;
}
gfx->drawArc(x + this->baseDimensions / 2, y + this->baseDimensions / 2, 0, 360, radius, (this->baseDimensions / 2) * scale, this->baseDimensions / 8 * scale, this->bgColor);
gfx->drawArc(x + this->baseDimensions / 2, y + this->baseDimensions / 2, arcStart, arcStart + arcLength, radius, (this->baseDimensions / 2) * scale, this->baseDimensions / 8 * scale, this->fgColor);
const int16_t steps = (this->baseDimensions / 2) * scale;
const int16_t arcRadius = this->baseDimensions / 8 * scale;
gfx->drawArc(x + this->baseDimensions / 2, y + this->baseDimensions / 2, 0.0f, 360.0f, steps, radius, arcRadius, this->bgColor);
gfx->drawArc(x + this->baseDimensions / 2, y + this->baseDimensions / 2, arcStart, arcStart + arcLength, steps, radius, arcRadius, this->fgColor);

if(showText and this->lastPulledText.size()) {
const char printMe = this->lastPulledText[0];
Expand Down Expand Up @@ -135,4 +137,4 @@ void OswProgressWidget::drawLinear(Graphics2DPrint* gfx, int x, int y, int width
gfx->setTextMiddleAligned();
gfx->print(this->lastPulledText.c_str());
}
}
}

0 comments on commit 8000970

Please sign in to comment.