summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'math.c')
-rw-r--r--math.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/math.c b/math.c
index b833872..e6e90f3 100644
--- a/math.c
+++ b/math.c
@@ -657,6 +657,8 @@ static float rect_x1(Rect r) { return r.pos.x; }
static float rect_y1(Rect r) { return r.pos.y; }
static float rect_x2(Rect r) { return r.pos.x + r.size.x; }
static float rect_y2(Rect r) { return r.pos.y + r.size.y; }
+static float rect_xmid(Rect r) { return r.pos.x + r.size.x * 0.5f; }
+static float rect_ymid(Rect r) { return r.pos.y + r.size.y * 0.5f; }
static void rect_coords(Rect r, float *x1, float *y1, float *x2, float *y2) {
*x1 = r.pos.x;