aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-09-18 18:59:47 +0200
committerThomas White <taw@bitwiz.org.uk>2013-09-18 18:59:47 +0200
commit1cebe9cbdd309b79430e6275874e2011c733c46c (patch)
treed00f5b1b54e9a1940dd9c4200131dbd845c368fe
parent0c8741a9b259f4b91f2fb0f219d774267860e1c4 (diff)
Take padding into account when fitting an image
-rw-r--r--src/wrap.c4
1 files changed, 2 insertions, 2 deletions
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);
}