Skip to content

fix(AtlasXML): fix setOrigin() producing wrong pivot on trimmed XML atlas frames#7246

Open
cmnemoi wants to merge 2 commits intophaserjs:masterfrom
cmnemoi-oss:fix/atlasXML
Open

fix(AtlasXML): fix setOrigin() producing wrong pivot on trimmed XML atlas frames#7246
cmnemoi wants to merge 2 commits intophaserjs:masterfrom
cmnemoi-oss:fix/atlasXML

Conversation

@cmnemoi
Copy link

@cmnemoi cmnemoi commented Feb 12, 2026

This PR

  • Fixes a bug

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 AtlasXML parsing for trimmed XML atlas frames by swapping the argument order passed to Frame.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 built dist/phaser-arcade-physics.js output).

Written by Cursor Bugbot for commit 6791bd0. This will update automatically on new commits. Configure here.

…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.
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 this pull request may close these issues.

[3.9.0] AtlasXML parser swaps trimmed and untrimmed sizes in setTrim(), breaking setOrigin()

1 participant