summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-05-30 22:43:12 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-05-30 22:43:12 +0200
commit17e2a29a5509939e6d2732d8b3d369b286f758b8 (patch)
tree31810b054e27ef9de5edc158dce309c2b8aabc50 /src/index.c
parenteca0d6e557f2cba64821001c619fdd26dda4c643 (diff)
Center images in index/thumbnail mode
Centering didn't work if the text below the thumbnail was wider than the thumbnail itself. Fixed.
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c14
1 files changed, 6 insertions, 8 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,