summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-24 13:25:42 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-24 13:25:42 -0500
commitb9079377328e9abeb20950ac144a7ebd98fde88e (patch)
tree785b79f91037990ec74195bdc0dad2cbd9248c60 /main.c
parent33b951f3b5d89c0ba7e7c7d821a9eafb37088872 (diff)
file selector scrolling
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.c b/main.c
index ca8c991..b7ee115 100644
--- a/main.c
+++ b/main.c
@@ -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);