summaryrefslogtreecommitdiff
path: root/src/math_helper.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-12-25 21:30:31 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2023-12-25 21:30:31 +0100
commitf04e0a86210aef19d646e3561798347649661d0b (patch)
treee59f2c5f0c212a80c1810c1a65dbfd1a7abe2d04 /src/math_helper.c
parent655ad2a85235a215dbcdf1753bdcccaa2308b529 (diff)
editor work
Diffstat (limited to 'src/math_helper.c')
-rw-r--r--src/math_helper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/math_helper.c b/src/math_helper.c
index 51db867..900b8aa 100644
--- a/src/math_helper.c
+++ b/src/math_helper.c
@@ -140,4 +140,8 @@ box get_render_box_of_square(platform_window* window, vec3f position, vec3f size
vec2f renderbl2 = (vec2f){render_x + info.px_incline*size.x, info.tile_height * position.y + info.tile_height*size.y - position.z*info.px_raised_per_h};
return (box){rendertl, rendertr, renderbl, renderbr, rendertl2, rendertr2, renderbl2, renderbr2};
+}
+
+bool rect_contains_point(vec2 point, vec2 tl, vec2 br) {
+ return (point.x >= tl.x && point.y >= tl.y && point.x <= br.x && point.y <= br.y);
} \ No newline at end of file