Improve WangBrush and TileLayerWangEdit behavior with empty color by bjorn · Pull Request #3774 · mapeditor/tiled (original) (raw)

added 8 commits

July 6, 2023 17:14

@bjorn

Mostly removing the special handling for erasing and changing the way filling is implemented.

@bjorn

@bjorn

@bjorn

Also slightly optimized it based on WangId::mergeWith.

@bjorn

Also exposed the new TileLayerWangEdit.erasingEnabled property in the scripting API.

Another change is that empty tiles no longer contribute to the desired WangId for the Terrain Fill mode (when corrections are disabled). Previously, only tiles outside of the map would not contribute to the desired WangId. This change yields nicer behavior when using the Wang Fill mode with the Stamp Brush, but it may need to be reconsidered for the Shape Fill tool or a later Terrain Fill tool.

@bjorn

This avoids the problem, that tiles set outside of the map by the algorithm will affect the tiles inside the map, which is not desirable.

Also, explicitly set tiles that are outside of the map to empty. This seems like a good idea, since it means the preview will still highlight those areas, but it will not affect the map once applied.

@bjorn

@bjorn

…bled

Don't let unset indices from the WangId based on surroundings override colors from currently present tiles.

bjorn added a commit that referenced this pull request

Jul 6, 2023

@bjorn

Mostly removing the special handling for erasing and changing the way filling is implemented. This does mean that terrain sets now support only 254 colors (down from 255).

This avoids the problem, that tiles set outside of the map by the algorithm will affect the tiles inside the map, which is not desirable.

Also, explicitly set tiles that are outside of the map to empty. This seems like a good idea, since it means the preview will still highlight those areas, but it will not affect the map once applied.

@bjorn bjorn deleted the wangedit-improvements branch

July 6, 2023 15:23

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})