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 /buffer.c | |
parent | 4cdbd1c8caf7fbd9ed584049312241a0e039e115 (diff) |
use dynamic arrays for mouse_clicks/mouse_releases
simplifies code
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3014,8 +3014,8 @@ void buffer_render(TextBuffer *buffer, Rect r) { if (buffer->is_line_buffer) { // handle clicks // this is only done for line buffers, so that ctrl+click works properly (and happens in one frame). - for (u32 i = 0; i < ted->nmouse_clicks[SDL_BUTTON_LEFT]; ++i) { - buffer_handle_click(ted, buffer, ted->mouse_clicks[SDL_BUTTON_LEFT][i], ted->mouse_click_times[SDL_BUTTON_LEFT][i]); + arr_foreach_ptr(ted->mouse_clicks[SDL_BUTTON_LEFT], MouseClick, click) { + buffer_handle_click(ted, buffer, click->pos, click->times); } } |