Skip to content

Commit cd92069

Browse files
authored
Merge pull request #4843 from theundergroundsorcerer/DrawCircleSector-quickfix
Add early return when angles are equal in DrawCircleSector and DrawCircleSectorLine functions.
2 parents 2f63a15 + 589ad0a commit cd92069

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rshapes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ void DrawCircleV(Vector2 center, float radius, Color color)
285285
// Draw a piece of a circle
286286
void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
287287
{
288+
if (startAngle == endAngle) return;
288289
if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero
289290

290291
// Function expects (endAngle > startAngle)
@@ -376,6 +377,7 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA
376377
// Draw a piece of a circle outlines
377378
void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
378379
{
380+
if (startAngle == endAngle) return;
379381
if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero issue
380382

381383
// Function expects (endAngle > startAngle)

0 commit comments

Comments
 (0)