[rshapes] Change DrawCircleSectorLines() and DrawRingLines()
`DrawCircleSectorLines()` and `DrawRingLines()` drew the cap lines even when drawing a full circle, which seems undesirable.
This commit is contained in:
parent
0d9ccb8756
commit
401526fe43
1 changed files with 12 additions and 4 deletions
|
|
@ -1576,8 +1576,13 @@ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float
|
|||
endAngle = tmp;
|
||||
}
|
||||
|
||||
bool showCapLines = true;
|
||||
// Drawing a whole circle, things get weird without limiting the circle to 360 degrees
|
||||
if (endAngle - startAngle >= 360.0f) endAngle = startAngle + 360.0f;
|
||||
if (endAngle - startAngle >= 360.0f)
|
||||
{
|
||||
showCapLines = false;
|
||||
endAngle = startAngle + 360.0f;
|
||||
}
|
||||
|
||||
int minSegments = (int)ceilf((endAngle - startAngle)/90);
|
||||
|
||||
|
|
@ -1592,7 +1597,6 @@ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float
|
|||
|
||||
float stepLength = (endAngle - startAngle)/(float)segments;
|
||||
float angle = startAngle;
|
||||
bool showCapLines = true;
|
||||
|
||||
rlBegin(RL_LINES);
|
||||
if (showCapLines)
|
||||
|
|
@ -1804,8 +1808,13 @@ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float s
|
|||
endAngle = tmp;
|
||||
}
|
||||
|
||||
bool showCapLines = true;
|
||||
// Drawing a whole circle, things get weird without limiting the circle to 360 degrees
|
||||
if (endAngle - startAngle >= 360.0f) endAngle = startAngle + 360.0f;
|
||||
if (endAngle - startAngle >= 360.0f)
|
||||
{
|
||||
showCapLines = false;
|
||||
endAngle = startAngle + 360.0f;
|
||||
}
|
||||
|
||||
int minSegments = (int)ceilf((endAngle - startAngle)/90);
|
||||
|
||||
|
|
@ -1826,7 +1835,6 @@ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float s
|
|||
|
||||
float stepLength = (endAngle - startAngle)/(float)segments;
|
||||
float angle = startAngle;
|
||||
bool showCapLines = true;
|
||||
|
||||
rlBegin(RL_LINES);
|
||||
if (showCapLines)
|
||||
|
|
|
|||
Loading…
Reference in a new issue