fix(AtlasXML): fix setOrigin() producing wrong pivot on trimmed XML atlas frames#7246
Open
cmnemoi wants to merge 2 commits intophaserjs:masterfrom
Open
fix(AtlasXML): fix setOrigin() producing wrong pivot on trimmed XML atlas frames#7246cmnemoi wants to merge 2 commits intophaserjs:masterfrom
cmnemoi wants to merge 2 commits intophaserjs:masterfrom
Conversation
…tlas frames The AtlasXML parser passed trimmed and untrimmed dimensions in the wrong order to setTrim(), causing frame.realWidth to return the trimmed size instead of the original size. This made setOrigin() compute incorrect pivots for any non-default origin. Swap the actualWidth/destWidth arguments to match the JSONHash and JSONArray parsers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR
The AtlasXML parser passed trimmed and untrimmed dimensions in the wrong order to setTrim(), causing frame.realWidth to return the trimmed size instead of the original size. This made setOrigin() compute incorrect pivots for any non-default origin.
This PR swaps the actualWidth/destWidth arguments to match the JSONHash and JSONArray parsers, fixing this behavior.
Closes #7245
Note
Low Risk
Small, localized bug fix that only changes how trimmed frame metadata is recorded; risk is limited to XML atlas trimming/origin behavior.
Overview
Fixes
AtlasXMLparsing for trimmed XML atlas frames by swapping the argument order passed toFrame.setTrim()so the original (untrimmed) size and the trimmed/cut size are stored correctly.This aligns XML atlas behavior with the JSON atlas parsers and prevents incorrect
setOrigin()pivot calculations on trimmed frames (change is reflected in the builtdist/phaser-arcade-physics.jsoutput).Written by Cursor Bugbot for commit 6791bd0. This will update automatically on new commits. Configure here.