diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 14 | ||||
-rw-r--r-- | src/thumbnail.c | 14 |
2 files changed, 12 insertions, 16 deletions
diff --git a/src/index.c b/src/index.c index c7c0a84..80f420c 100644 --- a/src/index.c +++ b/src/index.c @@ -398,14 +398,12 @@ void init_index_mode(void) break; } - if (opt.aspect) { - xxx = x + ((opt.thumb_w - www) / 2); - yyy = y + ((opt.thumb_h - hhh) / 2); - } else { - /* Ignore the aspect ratio and squash the image in */ - xxx = x; - yyy = y; - } + /* center image relative to the text below it (if any) */ + xxx = x + ((text_area_w - www) / 2); + yyy = y; + + if (opt.aspect) + yyy += (opt.thumb_h - hhh) / 2; /* Draw now */ gib_imlib_blend_image_onto_image(im_main, im_thumb, diff --git a/src/thumbnail.c b/src/thumbnail.c index c472fc0..f4304af 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -278,14 +278,12 @@ void init_thumbnail_mode(void) break; } - if (opt.aspect) { - xxx = x + ((opt.thumb_w - www) / 2); - yyy = y + ((opt.thumb_h - hhh) / 2); - } else { - /* Ignore the aspect ratio and squash the image in */ - xxx = x; - yyy = y; - } + /* center image relative to the text below it (if any) */ + xxx = x + ((td.text_area_w - www) / 2); + yyy = y; + + if (opt.aspect) + yyy += (opt.thumb_h - hhh) / 2; /* Draw now */ gib_imlib_blend_image_onto_image(td.im_main, |