Skip to content

Commit 81611f9

Browse files
committed
Fixed GIF delay order
1 parent 4355e9a commit 81611f9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

xrootgif.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ int load_pixmaps_from_image()
319319
desc.Top, desc.Left, desc.Width, desc.Height, gcb.DelayTime,
320320
desc.Interlace ? "True" : "False");
321321

322-
//TODO: detect invalid gif values, eg gcb delay
322+
//TODO: detect invald gif values, eg gcb delay
323323

324324
pmap = XCreatePixmap(display, root, root_attr.width,
325325
root_attr.height, root_attr.depth);
@@ -348,8 +348,7 @@ int load_pixmaps_from_image()
348348
imlib_free_image();
349349

350350
Background_anim.frames[i].p = pmap;
351-
// TODO: gcb.DelayTime is pre delay, not post delay
352-
Background_anim.frames[i].dur = opts.speed*(10000*gcb.DelayTime);
351+
Background_anim.frames[(i-1)%gif->ImageCount].dur = opts.speed*(10000*gcb.DelayTime);
353352
avg_delay += gcb.DelayTime;
354353
}
355354

0 commit comments

Comments
 (0)