Skip to content

Commit bd21ca5

Browse files
committed
fix animation restart on image change
1 parent dbcd850 commit bd21ca5

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ On success, merge to master.
231231

232232
## TODO
233233

234+
- animations do not stop and restart correctly on image change
235+
234236
- PDF page change does not change image size if pages vary in size
235237

236238
- ^C during a slow load leaves a file in /tmp, can we improve this?

src/tilesource.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -715,10 +715,6 @@ tile_source_page_flip(void *user_data)
715715

716716
int timeout;
717717

718-
// don't update invisible images
719-
if (!tile_source->visible)
720-
return FALSE;
721-
722718
/* By convention, GIFs default to 10fps.
723719
*/
724720
timeout = 100;
@@ -743,13 +739,13 @@ tile_source_page_flip(void *user_data)
743739
printf("tile_source_page_flip: timeout %d ms\n", timeout);
744740
#endif /*DEBUG*/
745741

746-
/* Only flip the page if everything has loaded.
742+
/* Only flip the page if everything has loaded and the image is visible.
747743
*/
748-
if (tile_source->rgb) {
744+
if (tile_source->rgb &&
745+
tile_source->visible)
749746
g_object_set(tile_source,
750747
"page", (page + 1) % tile_source->n_pages,
751748
NULL);
752-
}
753749

754750
return FALSE;
755751
}

0 commit comments

Comments
 (0)