Repository navigation
Place tile objects on isometric maps where Tiled draws them - #1759
Merged
obiot merged 2 commits intoOct 22, 2026
Merged
Conversation
adjustPosition converted x with half the tile width instead of the tile height, which only matches 2:1 tiles, and used the projected point as the top left of tile objects instead of their bottom center.
Member
|
thank you so much, excellent finding ! merging this one into 20.11, and I'll look at the setTile issue you found as well 👍 |
Moves the changelog entry under 20.11.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SeWCkETjW35ZbXDRswV1hx
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.
Description
Tile objects on isometric maps don't end up where Tiled draws them.
TMXIsometricRenderer.adjustPositionhad two problems:obj.xby half the tile width andobj.yby the tile height. Tiled stores isometric object positions in tile-height units on both axes (IsometricRenderer::pixelToScreenCoords), so this only matched 2:1 tilesadjustPositionalready doesy -= height, the isometric one overrides it without doing eitherNow both coordinates are divided by
tileheight, and objects with agidare moved left by half their width and up by their height.I compared against Tiled itself: rendered the same maps with Tiled's
tmxrasterizerand with melonJS in Chromium, and compared the object pixels.Added two tests to
tmxrenderer.spec.jswith the values Tiled produces for the 186x108 map, both fail before this change. Changelog entry added under a new_unreleased_heading.Separate from this PR:
TMXObject.setTilereplaces the object'swidth/heightwith the tileset's tile size for non-collection tilesets, so a tile object resized in Tiled is drawn at the tile's own size (on every orientation). In the 64x32 map above the 16x16 objects are drawn 40x40 because of that. Happy to look at it separately if you want it fixed.Type of change
Checklist
pnpm test: 8164 passed, 2 failed —text-gradient.spec.jsfails on master too,drawmesh_bench.spec.jstimed out once under load on my machine)scripts/build.js)Related issues
None that I found.