Fixing CanvasSpriteRenderer to correctly render sprites with rotated and trimmed base textures #8679
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
Changes made in #8615 to fix one case of broken canvas rendering ended up breaking canvas rendering in a different way (pixi-spine#460).
The fix I made previously didn't take into account the height/width swap required if a texture was rotated, and the fixes made in v6.5.0 were absolutely fine for this case.
I've prepared another demo site that covers all cases of the canvas rendering: https://vagabond-ambiguous-gerbera.glitch.me/
The previous red/blue atlas I used that had rotation but no trim remains, and a new purple/green atlas that has rotation and trim has been. Both were rendering correctly in v6.4, only one worked fine in 6.5.2 and 6.5.3, but both render correctly again with this fix applied.
I ran into difficulty trying to write a unit test for this, but I could spend more time in the future if that's required.
Closes #8678
Pre-Merge Checklist
npm run lint
)npm run test
)