diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-05 14:38:19 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-05 14:38:19 -0500 |
commit | 23771a9e599700aa9c80139abb122a0f6c97976a (patch) | |
tree | 9fd67445e59e4df66a5832378ba533d6dd7c73fe /math.c | |
parent | 3afd86c471e3ae6f806737908689a20eb686360a (diff) |
fix rendering if border-thickness is big
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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)); |