manage overlay opacity

This commit is contained in:
vcoppe
2024-06-26 18:46:03 +02:00
parent ac3cd9ecc5
commit a66303cd59
6 changed files with 104 additions and 12 deletions

View File

@@ -24,4 +24,16 @@ export function getLayers(node: LayerTreeType, layers: { [key: string]: boolean
}
});
return layers;
}
export function isSelected(node: LayerTreeType, id: string) {
return Object.keys(node).some((key) => {
if (key === id) {
return node[key];
}
if (typeof node[key] !== "boolean" && isSelected(node[key], id)) {
return true;
}
return false;
});
}