From 7334bdfa51778d143958811bd38d4719fcbf72f0 Mon Sep 17 00:00:00 2001 From: Bert Date: Sun, 27 Feb 2011 13:03:16 +0100 Subject: Revert "Save rotated png-files with S-key" This reverts commit 090ee5405b70d6dfa16a8ca3a691dbd556c41bdb. --- thumbs.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'thumbs.c') diff --git a/thumbs.c b/thumbs.c index df44c6f..e60bdc7 100644 --- a/thumbs.c +++ b/thumbs.c @@ -35,7 +35,6 @@ void tns_init(tns_t *tns, int cnt) { tns->cnt = tns->first = tns->sel = 0; tns->thumbs = (thumb_t*) s_malloc(cnt * sizeof(thumb_t)); memset(tns->thumbs, 0, cnt * sizeof(thumb_t)); - tns->cap = cnt; tns->dirty = 0; } @@ -52,7 +51,7 @@ void tns_free(tns_t *tns, win_t *win) { tns->thumbs = NULL; } -void tns_load(tns_t *tns, win_t *win, int n, const char *filename) { +void tns_load(tns_t *tns, win_t *win, const char *filename) { int w, h; float z, zw, zh; thumb_t *t; @@ -61,17 +60,10 @@ void tns_load(tns_t *tns, win_t *win, int n, const char *filename) { if (!tns || !win || !filename) return; - if (n >= tns->cap) - return; - else if (n >= tns->cnt) - tns->cnt = n + 1; - - if ((im = imlib_load_image(filename))) { + if ((im = imlib_load_image(filename))) imlib_context_set_image(im); - imlib_image_set_changes_on_disk(); - } else { + else imlib_context_set_image(im_broken); - } w = imlib_image_get_width(); h = imlib_image_get_height(); @@ -81,12 +73,10 @@ void tns_load(tns_t *tns, win_t *win, int n, const char *filename) { if (!im && z > 1.0) z = 1.0; - t = &tns->thumbs[n]; + t = &tns->thumbs[tns->cnt++]; t->w = z * w; t->h = z * h; - if (t->pm) - win_free_pixmap(win, t->pm); t->pm = win_create_pixmap(win, t->w, t->h); imlib_context_set_drawable(t->pm); imlib_context_set_anti_alias(1); -- cgit v1.2.3-54-g00ecf