summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorulteq <ulteq@web.de>2018-01-25 15:03:45 +0100
committerulteq <ulteq@web.de>2018-03-10 21:30:54 +0100
commit0235156ba92bff1f9b023a2fd91540bfca66ce1b (patch)
tree7baf4a2295f2e0d9fa77b7890ad98cdca4fb0e09
parentf111cef018432cd12d9989c4f8b4ecd3dfa186bb (diff)
Simplify --keep-zoom-vp handling
-rw-r--r--src/slideshow.c37
-rw-r--r--src/winwidget.c13
2 files changed, 7 insertions, 43 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index 071cb29..f3860ed 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -143,16 +143,6 @@ void feh_reload_image(winwidget w, int resize, int force_new)
Imlib_Image tmp;
int old_w, old_h;
- unsigned char tmode =0;
- int tim_x =0;
- int tim_y =0;
- double tzoom =0;
-
- tmode = w->mode;
- tim_x = w->im_x;
- tim_y = w->im_y;
- tzoom = w->zoom;
-
if (!w->file) {
im_weprintf(w, "couldn't reload, this image has no file associated with it.");
winwidget_render_image(w, 0, 0);
@@ -217,13 +207,6 @@ void feh_reload_image(winwidget w, int resize, int force_new)
w->im_w = gib_imlib_image_get_width(w->im);
w->im_h = gib_imlib_image_get_height(w->im);
}
- if (opt.keep_zoom_vp) {
- /* put back in: */
- w->mode = tmode;
- w->im_x = tim_x;
- w->im_y = tim_y;
- w->zoom = tzoom;
- }
winwidget_render_image(w, resize, 0);
return;
@@ -239,11 +222,6 @@ void slideshow_change_image(winwidget winwid, int change, int render)
*/
int our_filelist_len = filelist_len;
- unsigned char tmode =0;
- int tim_x =0;
- int tim_y =0;
- double tzoom =0;
-
/* Without this, clicking a one-image slideshow reloads it. Not very *
intelligent behaviour :-) */
if (filelist_len < 2 && opt.cycle_once == 0)
@@ -354,14 +332,6 @@ void slideshow_change_image(winwidget winwid, int change, int render)
last = NULL;
}
- if (opt.keep_zoom_vp) {
- /* pre loadimage - record settings */
- tmode = winwid->mode;
- tim_x = winwid->im_x;
- tim_y = winwid->im_y;
- tzoom = winwid->zoom;
- }
-
if (winwidget_loadimage(winwid, FEH_FILE(current_file->data))) {
int w = gib_imlib_image_get_width(winwid->im);
int h = gib_imlib_image_get_height(winwid->im);
@@ -376,13 +346,6 @@ void slideshow_change_image(winwidget winwid, int change, int render)
winwidget_reset_image(winwid);
winwid->im_w = w;
winwid->im_h = h;
- if (opt.keep_zoom_vp) {
- /* put back in: */
- winwid->mode = tmode;
- winwid->im_x = tim_x;
- winwid->im_y = tim_y;
- winwid->zoom = tzoom;
- }
if (render) {
winwidget_render_image(winwid, 1, 0);
}
diff --git a/src/winwidget.c b/src/winwidget.c
index 1ea6e9c..03aa9e8 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -426,8 +426,7 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
if (!winwid->full_screen && resize) {
winwidget_resize(winwid, winwid->im_w, winwid->im_h, 0);
- if (!opt.keep_zoom_vp)
- winwidget_reset_image(winwid);
+ winwidget_reset_image(winwid);
}
D(("winwidget_render_image resize %d force_alias %d im %dx%d\n",
@@ -953,10 +952,12 @@ void feh_debug_print_winwid(winwidget w)
void winwidget_reset_image(winwidget winwid)
{
- winwid->zoom = 1.0;
- winwid->old_zoom = 1.0;
- winwid->im_x = 0;
- winwid->im_y = 0;
+ if (!opt.keep_zoom_vp) {
+ winwid->zoom = 1.0;
+ winwid->old_zoom = 1.0;
+ winwid->im_x = 0;
+ winwid->im_y = 0;
+ }
winwid->im_angle = 0.0;
winwid->has_rotated = 0;
return;