Skip to content

Commit

Permalink
Improved behavior on the edge of the region when corrections are disa…
Browse files Browse the repository at this point in the history
…bled

Don't let unset indices from the WangId based on surroundings override
colors from currently present tiles.
  • Loading branch information
bjorn committed Jul 6, 2023
1 parent 73f0fcf commit 781c74d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tiled/wangfiller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ void WangFiller::apply(TileLayer &target)
const WangId surroundings = wangIdFromSurroundings(QPoint(x, y));
CellInfo &info = grid.add(x, y);

// Don't override explicitly set indexes
info.desired.mergeWith(surroundings, mask & ~info.mask);
// Don't override explicitly set indexes and don't override with
// unset indices from surroundings.
mask &= ~(info.mask | surroundings.mask(WangId::INDEX_MASK));
info.desired.mergeWith(surroundings, mask);
};

for (const QRect &rect : region) {
Expand Down

0 comments on commit 781c74d

Please sign in to comment.