Skip to content

Always use getAABB for fence bounds #478

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

Merged
merged 2 commits into from
May 7, 2020

Conversation

adroitwhiz
Copy link
Contributor

@adroitwhiz adroitwhiz commented Jul 9, 2019

Resolves

Resolves #477 and resolves #446

Proposed Changes

This PR changes the getFenceBounds function to use getAABB for all types of skins, as opposed to just bitmap skins.

Reason for Changes

getFastBounds does different things depending on external state, leading to inconsistent behavior.
It is also incompatible with Scratch 2.0, which fences all sprites, including vector ones, based on their AABB.

Test Coverage

I've added a fencing test which ensures fencing is the same before and after "if on edge, bounce" (which calls getBounds internally) is called.

@thisandagain
Copy link
Contributor

/cc @cwillisf @kchadha @BryceLTaylor

@cshaa
Copy link

cshaa commented Apr 10, 2020

Ping! What is the current status of this PR?

@fsih
Copy link
Contributor

fsih commented May 7, 2020

Testing:

  • Make sure to test games where you switch levels/die by walking off the screen
  • Clicking on a sprite in a sprite pane, using the if on edge bounce block, used to cause the bounding box of the sprite to shrink by ~half a pixel, but now it should NOT change.

Copy link
Contributor

@fsih fsih left a comment

Choose a reason for hiding this comment

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

LG! Thanks!

@adroitwhiz adroitwhiz merged commit 3612461 into scratchfoundation:develop May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking on a vector sprite in the sprite pane changes how far offscreen it can move Should Skin.getFenceBounds ever call getFastBounds?
5 participants