From 23771a9e599700aa9c80139abb122a0f6c97976a Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 5 Mar 2021 14:38:19 -0500 Subject: fix rendering if border-thickness is big --- math.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'math.c') diff --git a/math.c b/math.c index 75ec497..42f6cb9 100644 --- a/math.c +++ b/math.c @@ -748,6 +748,15 @@ static Rect rect_shrink(Rect r, float amount) { return r; } +// adds `amount` to all sides of r +static Rect rect_grow(Rect r, float amount) { + r.pos.x -= amount; + r.pos.y -= amount; + r.size.x += 2 * amount; + r.size.y += 2 * amount; + return r; +} + static v4 color_rgba_to_hsva(v4 rgba) { float R = rgba.x, G = rgba.y, B = rgba.z, A = rgba.w; float M = maxf(R, maxf(G, B)); -- cgit v1.2.3