mapeditor / mapeditor/tiled

Scripting: TileLayer.resize() and TileMap.resize() break TileLayer references

Open
#3,480 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

If I call `layer.resize()`, `layer` seems to become disconnected from the TileLayer in the map, and changes I make to it afterwards do not appear in the map. I have to get the layer from the map again in order to be able to make changes.

Similarly, if I call `map.resize()`, then *all* the tile layer references I saved prior to that become unusable, I have to make sure I get the layer references from the map *after* I resize. I am guessing this is because `map.resize()` calls `resize()` on its child layers.

Resizing a layer should not break existing references to that layer. If that can't be avoided, then TileLayer.resize() should at least return the new layer reference (in this case, TileMap.resize() will still wreck layer references, which should be documented).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use TileLayer.resize() and TileMap.resize() as the entry points and reproduce the reported loss of saved layer references after resizing. Done means existing TileLayer references remain usable after either resize, or the API behavior and any returned replacement reference are clearly established and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.