Clamp rounded rect radius
This commit is contained in:
parent
5c89f1d103
commit
396d52edcd
|
@ -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)
|
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;
|
f32 c = r * 4 * (sqrt(2) - 1) / 3;
|
||||||
|
|
||||||
oc_move_to(x + r, y);
|
oc_move_to(x + r, y);
|
||||||
|
|
Loading…
Reference in New Issue