diff options
author | pommicket <pommicket@gmail.com> | 2023-08-04 20:52:10 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-04 20:52:10 -0400 |
commit | ce199f9384f9f9376417110574a07cfd731e3a79 (patch) | |
tree | d87a14a789eea521252447cd6dd477295e5612b9 /ted.c | |
parent | 4cdbd1c8caf7fbd9ed584049312241a0e039e115 (diff) |
use dynamic arrays for mouse_clicks/mouse_releases
simplifies code
Diffstat (limited to 'ted.c')
-rw-r--r-- | ted.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |