Skip to content

Commit 4b20e06

Browse files
committed
Use logarithmic scaling for zoom mode
1 parent 9d662ab commit 4b20e06

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/events.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,8 @@ static void feh_event_handle_MotionNotify(XEvent * ev)
543543

544544
winwid = winwidget_get_from_window(ev->xmotion.window);
545545
if (winwid) {
546-
if (ev->xmotion.x > winwid->click_offset_x)
547-
winwid->zoom = winwid->old_zoom + (
548-
((double) ev->xmotion.x - (double) winwid->click_offset_x)
549-
/ 128.0);
550-
else
551-
winwid->zoom = winwid->old_zoom - (
552-
((double) winwid->click_offset_x - (double) ev->xmotion.x)
553-
/ 128.0);
546+
winwid->zoom = winwid->old_zoom *
547+
exp((double)(ev->xmotion.x - winwid->click_offset_x) / 128.0);
554548

555549
if (winwid->zoom < ZOOM_MIN)
556550
winwid->zoom = ZOOM_MIN;

0 commit comments

Comments
 (0)