Objects get deleted when deleting tiles


(Ron) #1

If I have an object selected, then I switch to a tile layer and select some tiles and hit delete, the object is also deleted. You can see it remains selected (moving ants) when the tile layer is selected.


(Thorbjørn Lindeijer) #2

Please always include the version when reporting issues. This is not the behavior of Tiled 1.1.5, but it is in the development snapshots.

It changed in the following commit:

Now all actions (Cut, Copy and Delete) will operate on both the tile selection as well as the object selection. Also the Paste action (and Paste in Place) can insert both tiles and objects. The behavior is not ideal, but it still really helps if you have content in multiple layers and you want to move it (be it within the same map or between maps).

Another thing is that while there is still a “current layer”, you can now select multiple layers. So just because the current layer is not an object layer, does not mean actions like Cut and Delete should not operate on selected objects. Should it be avoided if none of the selected layers are object layers? Maybe, but I’m afraid it would be a somewhat hidden inconsistency.

Of course, your feedback is important and I wonder how we can make it more intuitive. I have considered unifying the selection tools, such that we have one tool for modifying both tile and object selection. One problem with this it that especially the object “selection” tool does much more than just selection, it also implements all the interactions like moving, rotating and resizing. In addition, there are multiple tools for modifying tile selection. So I’m afraid to make a mess when trying to unify this.

Another possibility is to separate things again. We want to keep multi-layer selection, but maybe we could do away with cut/copy/delete working on both object layers and tile layers, and require either a tile selection tool or the object selection tool to be selected for the actions to work. But I don’t really like that either since tile layers and object layers are usually tightly coupled.

Whoops, what a long text, but at least now you know where this change comes from. Any alternative suggestions are welcome!


(Ron) #3

I’m running 2018.03.21

I see why you have it this way and I can see the use case, but objects and tiles just feel different enough that I don’t know if they should be paired like that. If you switch layers (object or tile), it seems natural to kill the selection. If you shift/option select, then keeping the selection makes sense. You’re clearly saying to want this to act on multiple layers.