Skip to content

Commit

Permalink
Use logarithmic scaling for zoom mode
Browse files Browse the repository at this point in the history
  • Loading branch information
myQwil committed May 24, 2024
1 parent 9d662ab commit 4b20e06
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
exp((double)(ev->xmotion.x - winwid->click_offset_x) / 128.0);

if (winwid->zoom < ZOOM_MIN)
winwid->zoom = ZOOM_MIN;
Expand Down

0 comments on commit 4b20e06

Please sign in to comment.