summaryrefslogtreecommitdiff
path: root/src/keyevents.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-02-12 14:02:36 +0100
committerDaniel Friesel <derf@finalrewind.org>2012-02-12 14:02:36 +0100
commitb6a1cff6db874f4708d5ff5ea6a17248610b7d90 (patch)
treedfb7c6b426e026970da9c04321e8e630b1bc5b6f /src/keyevents.c
parentb1e497e7555d2c72fb8b64a00c3e6804f36bd62f (diff)
Merge --scale-down / window dimension change patch
Diffstat (limited to 'src/keyevents.c')
-rw-r--r--src/keyevents.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/keyevents.c b/src/keyevents.c
index 0ada751..c551ae3 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -573,6 +573,9 @@ void feh_event_handle_keypress(XEvent * ev)
feh_event_invoke_action(winwid, 9);
}
else if (feh_is_kp(&keys.zoom_in, keysym, state)) {
+ if (!winwid->has_manual_zoom)
+ winwid->has_manual_zoom = 1;
+
winwid->old_zoom = winwid->zoom;
winwid->zoom = winwid->zoom * 1.25;
@@ -587,6 +590,9 @@ void feh_event_handle_keypress(XEvent * ev)
winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.zoom_out, keysym, state)) {
+ if (!winwid->has_manual_zoom)
+ winwid->has_manual_zoom = 1;
+
winwid->old_zoom = winwid->zoom;
winwid->zoom = winwid->zoom * 0.80;
@@ -601,17 +607,17 @@ void feh_event_handle_keypress(XEvent * ev)
winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.zoom_default, keysym, state)) {
+ if (!winwid->has_manual_zoom)
+ winwid->has_manual_zoom = 1;
+
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)) {
+ if (!winwid->has_manual_zoom)
+ winwid->has_manual_zoom = 1;
+
feh_calc_needed_zoom(&winwid->zoom, winwid->im_w, winwid->im_h, winwid->w, winwid->h);
winwidget_center_image(winwid);
winwidget_render_image(winwid, 0, 0);