From ff4d8a6b6ce5f389e92a7b26d33e17606ae6d51c Mon Sep 17 00:00:00 2001 From: Nathan Watson Date: Mon, 4 Jan 2021 01:07:57 -0800 Subject: [PATCH] Fix disappearing worldmap labels bug The "worldmap.labels" map is keyed by namedarea.id (corresponding to map.area), while the "mapLocations" map is keyed by map.id. This causes worldmap labels to be marked for removal when there's a namedarea.id that does not match any map.id, which happens to be true for all namedareas except crossglen and crossroads. This logic is unnecessary anyway, because WorldMapView.pushToModel is only invoked by WorldmapSegment.pushToModel, which only triggers when maps are added or moved, but not deleted. Deletions are instead handled by WorldmapSegment.elementChanged. As such, it should never be the case that a label is removable in a pushToModel call. --- .../gpl/rpg/atcontentstudio/ui/map/WorldMapView.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java index 68f16e9..796710a 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java @@ -521,16 +521,6 @@ public class WorldMapView extends JComponent implements Scrollable { } worldmap.getProject().getMap(id).addBacklink(worldmap); } - - List toRemove = new ArrayList(); - for (String s : worldmap.labels.keySet()) { - if (!mapLocations.containsKey(s)) { - toRemove.add(s); - } - } - for (String s : toRemove) { - worldmap.labels.remove(s); - } } }