From 1cebe9cbdd309b79430e6275874e2011c733c46c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 18 Sep 2013 18:59:47 +0200 Subject: Take padding into account when fitting an image --- src/wrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wrap.c') diff --git a/src/wrap.c b/src/wrap.c index 0bb2131..9f88001 100644 --- a/src/wrap.c +++ b/src/wrap.c @@ -636,12 +636,12 @@ static int get_size(const char *a, struct frame *fr, int *wp, int *hp) hs = strdup(x+1); if ( strcmp(ws, "fit") == 0 ) { - *wp = fr->w; + *wp = fr->w - (fr->lop.pad_l+fr->lop.pad_r); } else { *wp = strtoul(ws, NULL, 10); } if ( strcmp(ws, "fit") == 0 ) { - *hp = fr->h; + *hp = fr->h - (fr->lop.pad_t+fr->lop.pad_b); } else { *hp = strtoul(hs, NULL, 10); } -- cgit v1.2.3