From 5662c988fa199d071fdfd9e9defd8e09a3486b0c Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sun, 28 Feb 2021 14:01:10 -0500 Subject: tab moving working? --- main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 863c574..1d4e528 100644 --- a/main.c +++ b/main.c @@ -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) -- cgit v1.2.3