mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
fix: zones editor - legend to be toggable
This commit is contained in:
parent
8a4f28b321
commit
6d69eb855f
3 changed files with 4 additions and 2 deletions
|
|
@ -341,6 +341,8 @@ function editZones() {
|
|||
}
|
||||
|
||||
function toggleLegend() {
|
||||
if (legend.selectAll("*").size()) return clearLegend(); // hide legend
|
||||
|
||||
const filterBy = byId("zonesFilterType").value;
|
||||
const isFiltered = filterBy && filterBy !== "all";
|
||||
const visibleZones = pack.zones.filter(zone => !zone.hidden && (!isFiltered || zone.type === filterBy));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue