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:
parent
109d00cb14
commit
b2545e053a
3 changed files with 22 additions and 10 deletions
|
@ -31,6 +31,7 @@ int main(void)
|
|||
float startAngle = 0.0f;
|
||||
float endAngle = 180.0f;
|
||||
int segments = 0;
|
||||
int minSegments = 4;
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
@ -64,7 +65,8 @@ int main(void)
|
|||
segments = GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", NULL, segments, 0, 100);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||
minSegments = (int)ceilf((endAngle - startAngle) / 90);
|
||||
DrawText(TextFormat("MODE: %s", (segments >= minSegments)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= minSegments)? MAROON : DARKGRAY);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue