Clamp rounded rect radius

This commit is contained in:
Ilia Demianenko 2023-08-23 20:04:13 -07:00
parent d3e27df818
commit eaa43300d7
1 changed files with 1 additions and 0 deletions

View File

@ -1448,6 +1448,7 @@ void oc_rectangle_stroke(f32 x, f32 y, f32 w, f32 h)
void oc_rounded_rectangle_path(f32 x, f32 y, f32 w, f32 h, f32 r)
{
r = oc_min(r, oc_min(w / 2, h / 2));
f32 c = r * 4 * (sqrt(2) - 1) / 3;
oc_move_to(x + r, y);