diff options
author | Bert <ber.t@gmx.com> | 2011-08-19 18:46:17 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-08-19 18:46:17 +0200 |
commit | bb577d274dbd9981a726092a504466bc9b5c9bdb (patch) | |
tree | f3bbf611ddd904f80dfe20bb4d1171d1dc45ed3d /image.c | |
parent | 8b3ae5027e9490bd7edfeea3d3cd2fbc5ec4beaf (diff) | |
download | nsxiv-bb577d274dbd9981a726092a504466bc9b5c9bdb.tar.zst |
Added command to toggle gif animations
Diffstat (limited to 'image.c')
-rw-r--r-- | image.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -596,22 +596,18 @@ int img_frame_animate(img_t *img, int restart) { if (!img || !img->multi.cnt) return 0; - if (!img->multi.animate && !restart) - return 0; - - if (restart) { - img_frame_goto(img, 0); - img->multi.animate = 1; - } else if (img->multi.sel + 1 >= img->multi.cnt) { - if (!GIF_LOOP) { + if (img->multi.sel + 1 >= img->multi.cnt) { + if (restart || GIF_LOOP) { + img_frame_goto(img, 0); + } else { img->multi.animate = 0; return 0; - } else { - img_frame_goto(img, 0); } - } else { + } else if (!restart) { img_frame_goto(img, img->multi.sel + 1); } + img->multi.animate = 1; + return img->multi.frames[img->multi.sel].delay; } |