From efa266624c5d1de024f68934951edbcfb5aaff42 Mon Sep 17 00:00:00 2001 From: spelufo Date: Wed, 21 Feb 2024 10:56:37 -0300 Subject: [PATCH] Draw circles to fill gaps between bezier segments. --- src/rshapes.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rshapes.c b/src/rshapes.c index 1333f11d6..332676324 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1831,7 +1831,10 @@ void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color co void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 3) return; - + for (int i = 2; i < pointCount - 2; i += 2) + { + DrawCircleV(points[i], thick/2.0f, color); + } for (int i = 0; i < pointCount - 2; i += 2) { DrawSplineSegmentBezierQuadratic(points[i], points[i + 1], points[i + 2], thick, color); @@ -1842,7 +1845,10 @@ void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Col void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color) { if (pointCount < 4) return; - + for (int i = 3; i < pointCount - 3; i += 3) + { + DrawCircleV(points[i], thick/2.0f, color); + } for (int i = 0; i < pointCount - 3; i += 3) { DrawSplineSegmentBezierCubic(points[i], points[i + 1], points[i + 2], points[i + 3], thick, color);