From 8d4dc8eafbc70113bcff5f0be5282dfe6a2a6e10 Mon Sep 17 00:00:00 2001 From: Bigfoot71 Date: Sun, 23 Jun 2024 22:17:04 +0200 Subject: [PATCH] fix an iteration mistake --- src/rtextures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index 1082defdd..39c0f78f2 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3795,9 +3795,9 @@ void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color col { if (pointCount >= 3) { - for (int i = 1; i < pointCount; i++) + for (int i = 1; i < pointCount - 1; i++) { - ImageDrawTriangle(dst, points[0], points[i + 1], points[i + 2], color); + ImageDrawTriangle(dst, points[0], points[i], points[i + 1], color); } } }