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: Step time in SpriteAnimation must be positive #1387

Merged
merged 6 commits into from
Feb 21, 2022

Conversation

st-pasha
Copy link
Contributor

@st-pasha st-pasha commented Feb 20, 2022

Description

SpriteAnimation class now ensures that all animation frames have positive durations. If not, the update() method would go into an infinite loop.

Current constructors in SpriteAnimation converted into factory constructors so that validity checks can all be made in a single place.

Also make sure that non-looping single-frame SpriteAnimation works correctly and calls the onComplete callback after the frame ends.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • (NA) I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • (NA) I have updated/added relevant examples in examples.

Breaking Change

  • No, this is not a breaking change.

Related Issues

Closes #1372
Closes #1379

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

Copy link
Contributor

@wolfenrain wolfenrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spydon spydon enabled auto-merge (squash) February 21, 2022 17:57
@spydon spydon disabled auto-merge February 21, 2022 18:03
spydon and others added 2 commits February 21, 2022 20:03
@spydon spydon enabled auto-merge (squash) February 21, 2022 19:03
@spydon spydon merged commit 08e8eac into flame-engine:main Feb 21, 2022
@st-pasha st-pasha deleted the ps/animation branch February 21, 2022 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants