summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-10 19:00:40 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-10 19:00:40 +0200
commit4410230df37ad62894a7cbc410e1d01c99f4b13c (patch)
treee6cb38fab0db453921ae00e473b0a6a6dc900a70 /src
parent346459a1bed5ca7d30a568746591c1849c04daf8 (diff)
Fix zoom_default with --scale-down (closes #41)
Diffstat (limited to 'src')
-rw-r--r--src/keyevents.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/keyevents.c b/src/keyevents.c
index 9d5af5a..72b4168 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -530,10 +530,15 @@ void feh_event_handle_keypress(XEvent * ev)
winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.zoom_default, keysym, state)) {
- winwid->zoom = 1;
- winwid->old_zoom = 1.001; /* hack for --scale-down */
+ winwid->zoom = 1.0;
+ /* --scale-down will revert our operation if old_zoom == 1.0 */
+ if (opt.scale_down)
+ winwid->old_zoom = 1.001;
winwidget_center_image(winwid);
winwidget_render_image(winwid, 0, 0);
+ /* --scale-down will also do weird stuff if zoom is 1.0 */
+ if (opt.scale_down)
+ winwid->zoom = 1.001;
}
else if (feh_is_kp(&keys.zoom_fit, keysym, state)) {
feh_calc_needed_zoom(&winwid->zoom, winwid->im_w, winwid->im_h, winwid->w, winwid->h);