diff options
author | Bert <ber.t@gmx.com> | 2011-04-07 00:26:45 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-04-07 00:26:45 +0200 |
commit | 9fcf2c8f3467f163031b56c1750e2a27df0d3d64 (patch) | |
tree | 9738b709948fecfb401f04dcdd000b989c2366e0 /thumbs.c | |
parent | d7c1f0a85d08a10638d8621f80a8c2cbe215fa13 (diff) | |
download | nsxiv-9fcf2c8f3467f163031b56c1750e2a27df0d3d64.tar.zst |
Small refactoring in tns_load()
Diffstat (limited to 'thumbs.c')
-rw-r--r-- | thumbs.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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; |