From e52aecd82eca9a72958e3efcce9da09e57fbe5a9 Mon Sep 17 00:00:00 2001 From: Mike Will Date: Thu, 23 May 2024 21:03:25 -0400 Subject: [PATCH] Use logarithmic scaling for zoom mode --- src/events.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/events.c b/src/events.c index de9e7b3e..08d646f8 100644 --- a/src/events.c +++ b/src/events.c @@ -543,14 +543,8 @@ static void feh_event_handle_MotionNotify(XEvent * ev) winwid = winwidget_get_from_window(ev->xmotion.window); if (winwid) { - if (ev->xmotion.x > winwid->click_offset_x) - winwid->zoom = winwid->old_zoom + ( - ((double) ev->xmotion.x - (double) winwid->click_offset_x) - / 128.0); - else - winwid->zoom = winwid->old_zoom - ( - ((double) winwid->click_offset_x - (double) ev->xmotion.x) - / 128.0); + winwid->zoom = winwid->old_zoom * + exp2((double)(ev->xmotion.x - winwid->click_offset_x) / 128.0); if (winwid->zoom < ZOOM_MIN) winwid->zoom = ZOOM_MIN;