Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset to first frame #20

Closed
Wavesonics opened this issue Dec 9, 2013 · 2 comments
Closed

Reset to first frame #20

Wavesonics opened this issue Dec 9, 2013 · 2 comments
Assignees

Comments

@Wavesonics
Copy link
Contributor

It would be super sweet to get a method to reset a GIF while it's animating to the first frame. Essentially starting it over.

@ghost ghost assigned koral-- Dec 9, 2013
@koral--
Copy link
Owner

koral-- commented Dec 9, 2013

OK, good idea.

@koral--
Copy link
Owner

koral-- commented Dec 11, 2013

Done in 189f60c. I'm not sure how should it exactly work, so I've made several assumptions:

  • reset() method only rewinds input source and resets internal state. It doesn't restart stopped animation nor clear the canvas immediately. Animation will effectively be restarted just before rendering next frame.
  • If source cannot be rewound then nothing happens. This is applicable to files and some InputStreams only. Byte arrays and ByteBuffers are always rewindable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants