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

actions.scaleTo never completes when scaling exclusively on the x-axis #2470

Closed
reissbaker opened this issue Aug 26, 2022 · 1 comment · Fixed by #2471
Closed

actions.scaleTo never completes when scaling exclusively on the x-axis #2470

reissbaker opened this issue Aug 26, 2022 · 1 comment · Fixed by #2471

Comments

@reissbaker
Copy link
Contributor

Hello! 👋

I'm pretty sure I found a bug in the ScaleTo action; the isComplete method checks tx.scale.y against the x-axis, rather than the tx.scale.x against the x-axis, and so the action will never complete if, for example, you're only scaling the x-axis. The bug is on this line; I also cloned the repo, wrote a test, watched it fail, and then fixed the isComplete method; I'm opening this issue first since the PR checklist asks you to open an issue first. 😄

Steps to Reproduce

actor
  .scaleTo(vec(2, 1), vec(1, 1))
  .scaleTo(vec(3, 1), vec(1, 1)); // This will never run

Expected Result

The first scale would complete, and then the second scale would run and complete.

Actual Result

The first scale executes, but never believes it's completed, and so the second scale never runs.

Environment

  • browsers and versions: Chrome, but this is a problem in any browser; the line of code that checks the x-axis for completion actually checks the y-axis.
  • operating system: Windows
  • Excalibur versions: main branch

Current Workaround

Manually do the scaling yourself in an pre-/post-/update function instead of using the action.

@eonarheim
Copy link
Member

Hi @reissbaker! Thanks for the issue! Good find!

eonarheim pushed a commit that referenced this issue Aug 26, 2022
Fixes a bug I found in the `ScaleTo` action, where scaling on the x-axis exclusively may never complete. The `isComplete` method accidentally tested `tx.scale.y` against the x-axis, rather than testing `tx.scale.x` against the x-axis. I wrote the test first, watched it fail, and then fixed the bug and watched the test pass.
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 a pull request may close this issue.

2 participants