diff --git a/CHANGELOG.md b/CHANGELOG.md index a3f515e3..a7a72b0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - Fix crash when importing AdvanceMap metatiles while `enable_triple_layer_metatiles` is enabled. - Fix `File -> Open Project` not resolving folder shortcuts. - Fix bug where "Requires Itemfinder" checkbox is being checked by wrong data. +- Fix the map border not immediately reflecting Tileset Editor changes. ## [5.0.0] - 2022-10-30 ### Breaking Changes diff --git a/include/core/map.h b/include/core/map.h index 4ecea3a3..c2e3b0d0 100644 --- a/include/core/map.h +++ b/include/core/map.h @@ -99,6 +99,7 @@ public: QPixmap renderBorder(bool ignoreCache = false); void setDimensions(int newWidth, int newHeight, bool setNewBlockdata = true, bool enableScriptCallback = false); void setBorderDimensions(int newWidth, int newHeight, bool setNewBlockdata = true, bool enableScriptCallback = false); + void clearBorderCache(); void cacheBorder(); bool hasUnsavedChanges(); bool isWithinBounds(int x, int y); diff --git a/src/core/map.cpp b/src/core/map.cpp index 37fef3bf..68f21589 100644 --- a/src/core/map.cpp +++ b/src/core/map.cpp @@ -76,6 +76,10 @@ bool Map::borderBlockChanged(int i, const Blockdata &cache) { return layout->border.at(i) != cache.at(i); } +void Map::clearBorderCache() { + layout->cached_border.clear(); +} + void Map::cacheBorder() { layout->cached_border.clear(); for (const auto &block : layout->border) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b00c8858..10a38b6d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2363,8 +2363,10 @@ void MainWindow::onTilesetsSaved(QString primaryTilesetLabel, QString secondaryT } else { this->editor->project->getTileset(secondaryTilesetLabel, true); } - if (updated) + if (updated) { + this->editor->map->clearBorderCache(); redrawMapScene(); + } } void MainWindow::onWildMonDataChanged() {