Skip to content

Commit

Permalink
Fixed updating of used tilesets after resizing map
Browse files Browse the repository at this point in the history
When a tileset became unused due to a resize map or offset map
operation, the tileset could stay in the set of "used tilesets" reported
for that map.

This affected the scripting API Map.usedTilesets and caused an
unnecessary warning when trying to remove the affected tileset using the
"Remove Tileset" action.

Closes #3884
  • Loading branch information
bjorn committed Feb 8, 2024
1 parent c9ba9fd commit 0e3dfd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Windows: Fixed the support for WebP images (updated to Qt 6.6.1, #3661)
* Fixed mouse handling issue when zooming while painting (#3863)
* Fixed possible crash after a scripted tool disappears while active
* Fixed updating of used tilesets after resizing map (#3884)
* TMX format: Embedded images are now also supported on tilesets and image layers
* AppImage: Updated to Sentry 0.6.7

Expand Down
4 changes: 4 additions & 0 deletions src/libtiled/tilelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ void TileLayer::resize(QSize size, QPoint offset)

mChunks = newLayer->mChunks;
mBounds = newLayer->mBounds;
mUsedTilesets = newLayer->mUsedTilesets;
mUsedTilesetsDirty = newLayer->mUsedTilesetsDirty;
setSize(size);
}

Expand Down Expand Up @@ -655,6 +657,8 @@ void TileLayer::offsetTiles(QPoint offset,

mChunks = newLayer->mChunks;
mBounds = newLayer->mBounds;
mUsedTilesets = newLayer->mUsedTilesets;
mUsedTilesetsDirty = newLayer->mUsedTilesetsDirty;
}

void TileLayer::offsetTiles(QPoint offset)
Expand Down

0 comments on commit 0e3dfd6

Please sign in to comment.