diff options
author | Mark <mark@unserver.de> | 2010-09-18 17:26:47 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2010-09-18 17:27:32 +0200 |
commit | fec907f19cafc655d21bd8e123539b075aad8531 (patch) | |
tree | a11a7fedec25973a17d472291ddfa5cb08640514 /src | |
parent | 38e34c87a255e4a267e0b175828b3e91bec81f04 (diff) |
--bg-max fix for too large images
Signed-off-by: Daniel Friesel <derf@finalrewind.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/support.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/support.c b/src/support.c index a4bc02e..7e37632 100644 --- a/src/support.c +++ b/src/support.c @@ -235,21 +235,21 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, if(u>v) { w = x; - h = (((x * 10) / u) * v) / 10; + h = (((x * 100) / u) * v) / 100; t = (y - h) / 2; if(h>y) { + w = (((y * 100) / h) * w) / 100; h = y; - w = (((y * 10) / h) * w) / 10; s = (x - w) / 2; t = 0; } } else { h = y; - w = (((y * 10) / v) * u) / 10; + w = (((y * 100) / v) * u) / 100; s = (x - w) / 2; if(w>x) { + h = (((x * 100) / w) * h) / 100; w = x; - h = (((x * 10) / w) * h) / 10; s = 0; t = (y - h) / 2; } |