pixijs / gif

Plugin to support playback of animated GIF images in PixiJS.

Home Page:https://pixijs.io/gif/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using AnimatedGif.clone() should mark clones as dirty to trigger an update

greenpixels opened this issue · comments

Hey there,
I've noticed that cloning an AnimatedGIF and immediatly adding it to a container causes it to not be shown for a fraction of a second.

I've tried reproducing the behaviour on a StackBlitz:
https://stackblitz.com/edit/vitejs-vite-63qf4t?file=src%2Fmain.ts

I looked through the repository and if I am not mistaken it would be due to the fact that when we .clone() the AnimatedGIF ...

  • dirtyis initially set to false
  • updateFrameIndex has not been called yet, therefore not setting dirty = true
  • when updateFrameis called it won't execute since dirty is not set to true.