Commit 4410230d authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Fix zoom_default with --scale-down (closes #41)

parent 346459a1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ git HEAD
      <http://github.com/derf/feh/issues/44>
    * The 'A' key (toggle_aliasing) now actually changes the current window,
      and not just the default for new windows
    * The zoom_default key now works fine with --scale-down
      <http://github.com/derf/feh/issues/41>

Sat, 23 Apr 2011 22:00:27 +0200  Daniel Friesel <derf@finalrewind.org>

+7 −2
Original line number Diff line number Diff line
@@ -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);