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

fix: 🐛 play() after set_frame() resets the animation #135

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

theashraf
Copy link
Member

@theashraf theashraf commented Apr 13, 2024

Context:

This PR addresses an issue reported in dotlottie-web where calling play after set_frame fails to start the animation from the specified frame. Instead, the animation begins from the initial frame, disregarding the frame set by the user.

The underlying problem is within the play method, which incorrectly assumes that if the playback state is Stopped, it should always start from the initial frame, ignoring the current frame. This behavior is only appropriate if the animation has completed its cycle and then stopped.

Changes:

  • Updated the play method to initiate from the initial frame only if the animation has completed, but not when it is merely stopped.
  • Added several regression and integration tests for the play method to ensure:
    • The animation resumes correctly after a pause.
    • The animation resumes correctly after stopping.
    • The animation continues from the current frame.

Related Issue: dotlottie-web issue #174

Copy link

changeset-bot bot commented Apr 13, 2024

⚠️ No Changeset found

Latest commit: 00e2239

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@theashraf theashraf changed the title fix: 🐛 play() after setFrame() resets the animation fix: 🐛 play() after set_frame() resets the animation Apr 13, 2024
@theashraf theashraf marked this pull request as ready for review April 13, 2024 12:58
@theashraf theashraf merged commit 38097eb into main Apr 16, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Apr 18, 2024
@github-actions github-actions bot mentioned this pull request May 2, 2024
@github-actions github-actions bot mentioned this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants