Do you want to work on this issue?
You can request for a bounty in order to promote it!
TileMap.insertLayerAt() and GroupLayer.insertLayerAt() behave different #3486
juanitogan posted onGitHub
Describe the bug
TileMap.insertLayerAt()
and GroupLayer.insertLayerAt()
behave different with a new layer and size not set. TileMap version will resize the layer to the size of the map. GroupLayer version will leave the size at 0,0. The GroupLayer documentation says it should resize it (TileMap doc does not say).
To Reproduce
layer1 = new TileLayer("New Layer")
TileMap.insertLayerAt(0, layer1)
// versus
layer2 = new TileLayer("New Layer")
GroupLayer.insertLayerAt(0, layer2)
Expected behavior
TileMap doc:
Inserts the layer at the given index. The layer can’t already be part of a map.
GroupLayer doc:
Inserts the layer at the given index. The layer can't already be part of a map.
When adding a TileLayer to a map, the layer's width and height are automatically initialized to the size of the map (since Tiled 1.4.2).
Workaround is to set the size explicitly.
Specifications:
- OS: Windows 10
- Tiled Version: 1.9.2