summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-05 14:38:19 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-05 14:38:19 -0500
commit23771a9e599700aa9c80139abb122a0f6c97976a (patch)
tree9fd67445e59e4df66a5832378ba533d6dd7c73fe /math.c
parent3afd86c471e3ae6f806737908689a20eb686360a (diff)
fix rendering if border-thickness is big
Diffstat (limited to 'math.c')
-rw-r--r--math.c9
1 files changed, 9 insertions, 0 deletions
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));