mapeditor/tiled

Do you want to work on this issue?

You can request for a bounty in order to promote it!

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

eishiya posted onGitHub

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).


Good point. When a layer gets resized, I make a clone for undo purposes. Currently, the clone then gets resized and replaces the original, and they're swapped back on undo. We could probably resize the original instead, though we'll need to make sure the UI is updated in all the right places even without the layer getting replaced.

posted by bjorn over 2 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests