From ae00434e1cacfa345849500f6bab29b3de2cbdb2 Mon Sep 17 00:00:00 2001 From: Santiago Pelufo Date: Sat, 20 Jan 2024 10:43:37 -0300 Subject: [PATCH] [rshapes] Fix multisegment Bezier splines. It seems to me that these functions are wrong, if you step the index by 1 you move to a control point instead of the next segment. --- src/rshapes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 8e6708bf9..1333f11d6 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1832,7 +1832,7 @@ void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Col { if (pointCount < 3) return; - for (int i = 0; i < pointCount - 2; i++) + for (int i = 0; i < pointCount - 2; i += 2) { DrawSplineSegmentBezierQuadratic(points[i], points[i + 1], points[i + 2], thick, color); } @@ -1843,7 +1843,7 @@ void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color c { if (pointCount < 4) return; - for (int i = 0; i < pointCount - 3; i++) + for (int i = 0; i < pointCount - 3; i += 3) { DrawSplineSegmentBezierCubic(points[i], points[i + 1], points[i + 2], points[i + 3], thick, color); }