Commit c2ad802b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Zoom button: Do 100% zoom upon release, not click.

Fixes the annoying 100% zoom and then continuing where it was.
parent 287687d7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ git HEAD
    * Do not change to the next slide when executing an action with ; as first
      character (this character is stripped when executing the action)
    * Speed up panning, zooming etc. by hiding image overlay text
    * Zoom button: Zoom to 100% on button release, not button click

Tue, 24 Aug 2010 19:23:36 +0200  Daniel Friesel <derf@chaosdorf.de>

+4 −5
Original line number Diff line number Diff line
@@ -779,11 +779,10 @@ will warp your cursor to the opposite border so you can continue panning.
.Pp
When clicking the zoom button and immediately releasing it, the image will be
back at 100% zoom.  When clicking it and moving the mouse while holding the
button down, the zoom will be continued at the previous zoom level.  Do not let
the short snapback to 100% confuse you, it'll be removed as soon as you move
the mouse.  The zoom will always happen so that the pixel on which you entered
the zoom mode remains stationary.  So, to enlarge a specific part of an image,
click the zoom button on that part.
button down, the zoom will be continued at the previous zoom level.  The zoom
will always happen so that the pixel on which you entered the zoom mode
remains stationary.  So, to enlarge a specific part of an image, click the
zoom button on that part.
.
.Sh SIGNALS
In slideshow mode,
+9 −5
Original line number Diff line number Diff line
@@ -114,16 +114,12 @@ static void feh_event_handle_ButtonPress(XEvent * ev)
			winwid->click_offset_x = ev->xbutton.x;
			winwid->click_offset_y = ev->xbutton.y;
			winwid->old_zoom = winwid->zoom;
			winwid->zoom = 1.0;

			/* required to adjust the image position in zoom mode */
			winwid->im_click_offset_x = (winwid->click_offset_x
					- winwid->im_x) / winwid->old_zoom;
			winwid->im_click_offset_y = (winwid->click_offset_y
					- winwid->im_y) / winwid->old_zoom;

			winwidget_center_image(winwid);
			winwidget_render_image(winwid, 0, 0);
		}
	} else if (ev->xbutton.button == opt.reload_button) {
		D(("Reload Button Press event\n"));
@@ -242,7 +238,15 @@ static void feh_event_handle_ButtonRelease(XEvent * ev)
			D(("Disabling mode\n"));
			opt.mode = MODE_NORMAL;
			winwid->mode = MODE_NORMAL;

			if ((ev->xbutton.button == opt.zoom_button)
					&& (ev->xbutton.x == winwid->click_offset_x)
					&& (ev->xbutton.y == winwid->click_offset_y)) {
				winwid->zoom = 1.0;
				winwidget_center_image(winwid);
			} else
				winwidget_sanitise_offsets(winwid);

			winwidget_render_image(winwid, 0, 1);
		}
	} else if ((ev->xbutton.button == opt.blur_button)