From 9b2efc45522bdce8cb9462ccaf3b1f5a25888e54 Mon Sep 17 00:00:00 2001 From: Risu-swift <44291969+Risu-swift@users.noreply.github.com> Date: Wed, 2 Sep 2026 16:01:04 +0530 Subject: [PATCH] [rtextures] Fix ImageDrawCircle asymmetry (#6118) ImageDrawCircle filled 2*radius pixels wide but 2*radius + 1 tall. Each horizontal span started at centerX - x with width 2*x, which covers centerX - x through centerX + x - 1, leaving the column at centerX + x unwritten. The result was one column short on the right, off-centre, and inconsistent with ImageDrawCircleLines, which is 2*radius + 1 in both directions. Widen the four spans by one pixel so the fill is (2r+1) x (2r+1), centred on (centerX, centerY) and aligned with ImageDrawCircleLines. Fixes #6117 --- src/rtextures.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index ee4a867ce..47d0e54d2 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3977,10 +3977,10 @@ void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color col while (y >= x) { - ImageDrawRectangle(dst, centerX - x, centerY + y, x*2, 1, color); - ImageDrawRectangle(dst, centerX - x, centerY - y, x*2, 1, color); - ImageDrawRectangle(dst, centerX - y, centerY + x, y*2, 1, color); - ImageDrawRectangle(dst, centerX - y, centerY - x, y*2, 1, color); + ImageDrawRectangle(dst, centerX - x, centerY + y, x*2 + 1, 1, color); + ImageDrawRectangle(dst, centerX - x, centerY - y, x*2 + 1, 1, color); + ImageDrawRectangle(dst, centerX - y, centerY + x, y*2 + 1, 1, color); + ImageDrawRectangle(dst, centerX - y, centerY - x, y*2 + 1, 1, color); x++; if (decesionParameter > 0)