diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-24 13:25:42 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-24 13:25:42 -0500 |
commit | b9079377328e9abeb20950ac144a7ebd98fde88e (patch) | |
tree | 785b79f91037990ec74195bdc0dad2cbd9248c60 /main.c | |
parent | 33b951f3b5d89c0ba7e7c7d821a9eafb37088872 (diff) |
file selector scrolling
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -256,6 +256,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); + ted->scroll_total_x = ted->scroll_total_y = 0; //printf("%p\n",(void *)ted->drag_buffer); @@ -271,6 +272,8 @@ int main(int argc, char **argv) { case SDL_MOUSEWHEEL: { // scroll with mouse wheel Sint32 dx = event.wheel.x, dy = -event.wheel.y; + ted->scroll_total_x += dx; + ted->scroll_total_y += dy; double scroll_speed = 2.5; if (ted->active_buffer) buffer_scroll(ted->active_buffer, dx * scroll_speed, dy * scroll_speed); |