Skip to content

Fix tileset tile ID remapping after resize - #1260

Open
jamiemccarter wants to merge 1 commit into
deepnight:masterfrom
jamiemccarter:fix/tileset-resize-remapping
Open

jamiemccarter wants to merge 1 commit into
deepnight:masterfrom
jamiemccarter:fix/tileset-resize-remapping

Conversation

@jamiemccarter

Copy link
Copy Markdown

What was wrong

Resizing a tileset could cause existing tile IDs to be remapped incorrectly. The remapping logic derived the previous column count from the old pixel width instead of using the tileset's stored grid width, and height-only expansion could trigger unnecessary remapping.

What changed

  • Preserve the previous tile-grid width when remapping tile IDs.
  • Skip remapping when the tileset only grows vertically and its grid width is unchanged.
  • Continue remapping when the tile layout genuinely changes.

Testing

Built the project locally and imported assets using the updated build. Tileset resizing and tile IDs behaved as expected.

## What was wrong

Resizing a tileset could cause existing tile IDs to be remapped incorrectly. The remapping logic derived the previous column count from the old pixel width instead of using the tileset's stored grid width, and height-only expansion could trigger unnecessary remapping.

## What changed

- Preserve the previous tile-grid width when remapping tile IDs.
- Skip remapping when the tileset only grows vertically and its grid width is unchanged.
- Continue remapping when the tile layout genuinely changes.

## Testing

Built the project locally and imported assets using the updated build. Tileset resizing and tile IDs behaved as expected.
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.

1 participant