From 17e2a29a5509939e6d2732d8b3d369b286f758b8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 30 May 2010 22:43:12 +0200 Subject: Center images in index/thumbnail mode Centering didn't work if the text below the thumbnail was wider than the thumbnail itself. Fixed. --- src/thumbnail.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/thumbnail.c') 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, -- cgit v1.2.3