summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-10-21 18:51:06 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-10-21 18:51:06 +0200
commitc9a7b4d88e109e52a6395573336af7ac33b60baa (patch)
tree849d75d9780a8b97c1e3e172de228b9f754ea70e
parent4947bd2277cf8772efc392303e47190b4de3292b (diff)
downloadfeh-c9a7b4d88e109e52a6395573336af7ac33b60baa.zip
winwidget.c: Add experimental --scale-down tiling support (#54)
-rw-r--r--src/winwidget.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index bc530ee..c678d5b 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -381,6 +381,7 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
int sx, sy, sw, sh, dx, dy, dw, dh;
int calc_w, calc_h;
int antialias = 0;
+ int need_center = winwid->had_resize;
if (!winwid->full_screen && resize) {
winwidget_resize(winwid, winwid->im_w, winwid->im_h);
@@ -503,6 +504,10 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
winwid->im_y = (int) (max_h - (winwid->im_h * winwid->zoom)) >> 1;
}
}
+ else if (need_center && !winwid->full_screen && opt.scale_down) {
+ winwid->im_x = (int) (winwid->w - (winwid->im_w * winwid->zoom)) >> 1;
+ winwid->im_y = (int) (winwid->h - (winwid->im_h * winwid->zoom)) >> 1;
+ }
/* Now we ensure only to render the area we're looking at */
dx = winwid->im_x;