Fix tileset change not updating border

This commit is contained in:
GriffinR 2023-01-16 20:16:25 -05:00
parent debf9d99f0
commit c233e3cd59
4 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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);

View file

@ -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)

View file

@ -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() {