From eaa43300d7634fb8c767db94451ecefed5a44920 Mon Sep 17 00:00:00 2001 From: Ilia Demianenko Date: Wed, 23 Aug 2023 20:04:13 -0700 Subject: [PATCH] Clamp rounded rect radius --- src/graphics/graphics_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/graphics/graphics_common.c b/src/graphics/graphics_common.c index d050df9..06cb44b 100644 --- a/src/graphics/graphics_common.c +++ b/src/graphics/graphics_common.c @@ -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); -- 2.25.1