summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorulteq <ulteq@web.de>2018-01-12 17:59:40 +0100
committerulteq <ulteq@web.de>2018-03-10 21:30:54 +0100
commitd9c1cab85af4107cde67a2aba5657fc0b680f852 (patch)
tree281dad3c9afff3bcb4294dc8c591102f01907bc7 /src
parent30c40b7e7fc573e1bda6264c507e4883791a1c05 (diff)
Fix --screen-clip window dimension calculation
Diffstat (limited to 'src')
-rw-r--r--src/winwidget.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index 3c90b57..576ff58 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -820,8 +820,12 @@ void winwidget_resize(winwidget winwid, int w, int h, int force_resize)
if (winwid && ((winwid->w != w) || (winwid->h != h))) {
/* winwidget_clear_background(winwid); */
if (opt.screen_clip) {
- winwid->w = (w > scr_width) ? scr_width : w;
- winwid->h = (h > scr_height) ? scr_height : h;
+ double required_zoom = 1.0;
+ int max_w = (w > scr_width) ? scr_width : w;
+ int max_h = (h > scr_height) ? scr_height : h;
+ feh_calc_needed_zoom(&required_zoom, winwid->im_w, winwid->im_h, max_w, max_h);
+ winwid->w = winwid->im_w * required_zoom;
+ winwid->h = winwid->im_h * required_zoom;
}
if (winwid->full_screen) {
XTranslateCoordinates(disp, winwid->win, attributes.root,