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;