Optimise fillEllipse function. ~36% faster (#478)

* Optimised fillEllipse function

* Cleaned up code
This commit is contained in:
DS-Aditya-928
2025-09-17 12:08:09 -04:00
committed by GitHub
parent 9e06b6d222
commit 4c89798ccd
+2 -3
View File
@@ -430,14 +430,13 @@ void Adafruit_GFX::fillEllipse(int16_t x0, int16_t y0, int16_t rw, int16_t rh,
// region 1
while ((twoRh2 * x) < (twoRw2 * y)) {
drawFastHLine(x0 - x, y0 + y, 2 * x + 1, color);
drawFastHLine(x0 - x, y0 - y, 2 * x + 1, color);
x++;
if (decision < 0) {
decision += rh2 + (twoRh2 * x);
} else {
decision += rh2 + (twoRh2 * x) - (twoRw2 * y);
drawFastHLine(x0 - (x - 1), y0 + y, 2 * (x - 1) + 1, color);
drawFastHLine(x0 - (x - 1), y0 - y, 2 * (x - 1) + 1, color);
y--;
}
}