[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.
This commit is contained in:
Santiago Pelufo 2024-01-20 10:43:37 -03:00 committed by GitHub
parent b600786c52
commit ae00434e1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}