mirror of
https://github.com/raysan5/raylib.git
synced 2026-05-25 06:18:18 +00:00
Adjust segment calculation in DrawRectangleRounded to be consistent with DrawRectangleRoundedLinesEx (#5875)
This commit is contained in:
@@ -960,7 +960,7 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co
|
||||
{
|
||||
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
||||
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
||||
segments = (int)(ceilf(2*PI/th)/4.0f);
|
||||
segments = (int)(ceilf(2*PI/th)/2.0f);
|
||||
if (segments <= 0) segments = 4;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user