diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-28 14:01:10 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-28 14:01:10 -0500 |
commit | 5662c988fa199d071fdfd9e9defd8e09a3486b0c (patch) | |
tree | 95cd9999fcd5e9a300093a6c11c9d6905e3a45a9 /main.c | |
parent | 7089b92ff5606f1e9b934e2236b0295dcab922ae (diff) |
tab moving working?
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,4 @@ // @TODO: -// - move tabs between nodes // - :split-swap // - fix: ctrl+f something, then switch to another tab (hl rects still showing up) @@ -391,6 +390,7 @@ int main(int argc, char **argv) { bool alt_down = keyboard_state[SDL_SCANCODE_LALT] || keyboard_state[SDL_SCANCODE_RALT]; memset(ted->nmouse_clicks, 0, sizeof ted->nmouse_clicks); + memset(ted->nmouse_releases, 0, sizeof ted->nmouse_releases); ted->scroll_total_x = ted->scroll_total_y = 0; ted_update_window_dimensions(ted); @@ -494,6 +494,13 @@ int main(int argc, char **argv) { } } } break; + case SDL_MOUSEBUTTONUP: { + Uint8 button = event.button.button; + v2 pos = V2((float)event.button.x, (float)event.button.y); + if (ted->nmouse_releases[button] < arr_count(ted->mouse_releases[button])) { + ted->mouse_releases[button][ted->nmouse_releases[button]++] = pos; + } + } break; case SDL_MOUSEMOTION: { float x = (float)event.motion.x, y = (float)event.motion.y; if (ted->drag_buffer != ted->active_buffer) |