From 9fcf2c8f3467f163031b56c1750e2a27df0d3d64 Mon Sep 17 00:00:00 2001 From: Bert Date: Thu, 7 Apr 2011 00:26:45 +0200 Subject: Small refactoring in tns_load() --- thumbs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'thumbs.c') diff --git a/thumbs.c b/thumbs.c index e8e483d..da2adee 100644 --- a/thumbs.c +++ b/thumbs.c @@ -82,11 +82,14 @@ void tns_load(tns_t *tns, win_t *win, int n, const char *filename) { w = imlib_image_get_width(); h = imlib_image_get_height(); - zw = (float) THUMB_SIZE / (float) w; - zh = (float) THUMB_SIZE / (float) h; - z = MIN(zw, zh); - if (!im && z > 1.0) + + if (im) { + zw = (float) THUMB_SIZE / (float) w; + zh = (float) THUMB_SIZE / (float) h; + z = MIN(zw, zh); + } else { z = 1.0; + } t->w = z * w; t->h = z * h; -- cgit v1.2.3