Skip to content

Fix flipY on WebGL tilemap tiles moving the tile sideways - #7403

Open
vtxe02023274 wants to merge 1 commit into
phaserjs:masterfrom
vtxe02023274:fix/tile-flipy
Open

vtxe02023274 wants to merge 1 commit into
phaserjs:masterfrom
vtxe02023274:fix/tile-flipy

Conversation

@vtxe02023274

Copy link
Copy Markdown

This PR

  • Fixes a bug

Describe the changes below:

Fixes #7382

TransformerTile offset x by the frame height when a tile had flipY, so a vertically flipped tile on a WebGL TilemapLayer was drawn off to the side instead of flipped in place. It now offsets y, the same way the flipX branch offsets x. This is the change @shogeki's report points at.

The existing unit test expected the old quad (y + height = -48). It now expects the flipped quad and uses a 32x16 frame so mixing up x and y fails the test.

Checked in Chrome with a 3 tile layer (plain, flipY, flipX + flipY) rendered with WebGL and Canvas and compared pixel by pixel. Before the change the two flipped tiles are drawn in the wrong place on WebGL; after it WebGL matches Canvas.

Tiled maps are not affected, their flip flags become rotation + flipX in ParseGID. Only tile.flipY set from code goes through this branch.

The flipY branch of TransformerTile offset x by the frame height instead of y. Fixes phaserjs#7382
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.

flipY renders tile incorrectly

1 participant