Minimum number of segments in circle sector functions changed from hard-coded to based on degree range. (#1707)

Co-authored-by: Simon <simon@frithrah.com>
This commit is contained in:
frithrah 2021-04-06 13:29:58 +01:00 committed by GitHub
parent 109d00cb14
commit b2545e053a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 10 deletions

View file

@ -33,6 +33,7 @@ int main(void)
float startAngle = 0.0f;
float endAngle = 360.0f;
int segments = 0;
int minSegments = 4;
bool drawRing = true;
bool drawRingLines = false;
@ -77,7 +78,8 @@ int main(void)
drawCircleLines = GuiCheckBox((Rectangle){ 600, 380, 20, 20 }, "Draw CircleLines", drawCircleLines);
//------------------------------------------------------------------------------
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 270, 10, (segments >= 4)? MAROON : DARKGRAY);
int minSegments = (int)ceilf((endAngle - startAngle) / 90);
DrawText(TextFormat("MODE: %s", (segments >= minSegments)? "MANUAL" : "AUTO"), 600, 270, 10, (segments >= minSegments)? MAROON : DARKGRAY);
DrawFPS(10, 10);