Krolyxon
Commit 9fcf2c8

Branches

Refs →

nsxiv9fcf2c8

Small refactoring in tns_load()

Author
Bert
Date
2011-04-07 00:26 +0200
Parent
d7c1f0a
Commit
9fcf2c8f3467f163031b56c1750e2a27df0d3d64

+7 −4

1 file changed

  1. M thumbs.c +7 −4
M thumbs.c View
@@ -82,11 +82,14 @@ void tns_load(tns_t *tns, win_t *win, int n, const char *filename) {
8282
8383 w = imlib_image_get_width();
8484 h = imlib_image_get_height();
85− zw = (float) THUMB_SIZE / (float) w;
86− zh = (float) THUMB_SIZE / (float) h;
87− z = MIN(zw, zh);
88− if (!im && z > 1.0)
85+
86+ if (im) {
87+ zw = (float) THUMB_SIZE / (float) w;
88+ zh = (float) THUMB_SIZE / (float) h;
89+ z = MIN(zw, zh);
90+ } else {
8991 z = 1.0;
92+ }
9093
9194 t->w = z * w;
9295 t->h = z * h;