From f2a2b9076bca2f8c3cf2bb64aa44a651f5f00838 Mon Sep 17 00:00:00 2001 From: Hampus Adolfsson Date: Tue, 11 Aug 2026 00:18:31 +0200 Subject: [PATCH] Fix off-by-one bug in drawCircle The next decision variable should be calculated based on the *current* x/y values --- wled00/FX_2Dfcn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp index a0cc3c4461..98df667286 100644 --- a/wled00/FX_2Dfcn.cpp +++ b/wled00/FX_2Dfcn.cpp @@ -478,13 +478,13 @@ void Segment::drawCircle(uint16_t cx, uint16_t cy, uint8_t radius, uint32_t col, setPixelColorXY(cx + dx, cy + dy, col); setPixelColorXY(cx + dy, cy + dx, col); } - x++; if (d > 0) { - y--; d += 4 * (x - y) + 10; + y--; } else { d += 4 * x + 6; } + x++; } } }