summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-04 20:52:10 -0400
committerpommicket <pommicket@gmail.com>2023-08-04 20:52:10 -0400
commitce199f9384f9f9376417110574a07cfd731e3a79 (patch)
treed87a14a789eea521252447cd6dd477295e5612b9 /ted.c
parent4cdbd1c8caf7fbd9ed584049312241a0e039e115 (diff)
use dynamic arrays for mouse_clicks/mouse_releases
simplifies code
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ted.c b/ted.c
index 2322987..e952ece 100644
--- a/ted.c
+++ b/ted.c
@@ -80,6 +80,13 @@ u32 ted_get_key_modifier(Ted *ted) {
| alt_down << KEY_MODIFIER_ALT_BIT;
}
+bool ted_clicked_in_rect(Ted *ted, Rect rect) {
+ arr_foreach_ptr(ted->mouse_clicks[SDL_BUTTON_LEFT], MouseClick, click) {
+ if (rect_contains_point(rect, click->pos))
+ return true;
+ }
+ return false;
+}
void ted_set_message(Ted *ted, MessageType type, const char *fmt, ...) {
va_list args;