Fix border not updating when tileset is changed

This commit is contained in:
GriffinR 2023-06-30 00:51:18 -04:00
parent 4ec5238abb
commit cdf4556e23
3 changed files with 4 additions and 3 deletions

View file

@ -14,6 +14,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
- Fix text boxes in the Palette Editor calculating color incorrectly. - Fix text boxes in the Palette Editor calculating color incorrectly.
- Fix default object sprites retaining dimensions and transparency of the previous sprite. - Fix default object sprites retaining dimensions and transparency of the previous sprite.
- Fix connections not being deleted when the map name text box is cleared. - Fix connections not being deleted when the map name text box is cleared.
- Fix the map border not updating when a tileset is changed.
## [5.1.1] - 2023-02-20 ## [5.1.1] - 2023-02-20
### Added ### Added

View file

@ -1918,6 +1918,7 @@ void Editor::updatePrimaryTileset(QString tilesetLabel, bool forceLoad)
{ {
map->layout->tileset_primary_label = tilesetLabel; map->layout->tileset_primary_label = tilesetLabel;
map->layout->tileset_primary = project->getTileset(tilesetLabel, forceLoad); map->layout->tileset_primary = project->getTileset(tilesetLabel, forceLoad);
map->clearBorderCache();
} }
} }
@ -1927,6 +1928,7 @@ void Editor::updateSecondaryTileset(QString tilesetLabel, bool forceLoad)
{ {
map->layout->tileset_secondary_label = tilesetLabel; map->layout->tileset_secondary_label = tilesetLabel;
map->layout->tileset_secondary = project->getTileset(tilesetLabel, forceLoad); map->layout->tileset_secondary = project->getTileset(tilesetLabel, forceLoad);
map->clearBorderCache();
} }
} }

View file

@ -2385,10 +2385,8 @@ void MainWindow::onTilesetsSaved(QString primaryTilesetLabel, QString secondaryT
} else { } else {
this->editor->project->getTileset(secondaryTilesetLabel, true); this->editor->project->getTileset(secondaryTilesetLabel, true);
} }
if (updated) { if (updated)
this->editor->map->clearBorderCache();
redrawMapScene(); redrawMapScene();
}
} }
void MainWindow::onWildMonDataChanged() { void MainWindow::onWildMonDataChanged() {