Skip to content

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