Fix bug with clipping

This commit is contained in:
2026-04-07 12:37:43 +02:00
parent 9a8f6c7dc5
commit a3ca2eb372
5 changed files with 125 additions and 124 deletions

View File

@@ -24,7 +24,7 @@ UI.contentMenuTabs = `
</ul>
<!-- Tab panes -->
<div class="tab-content ps-4 ms-3" style="overflow: auto">
<div class="tab-content ps-4 ms-3 overflow-y-auto">
<div class="tab-pane active p-3 ms-3" id="layer" role="tabpanel" aria-labelledby="layer-tab" tabindex="0"></div>
<div class="tab-pane p-3" id="media" role="tabpanel" aria-labelledby="media-tab" tabindex="0"></div>
</div>

View File

@@ -9,7 +9,13 @@
* @param {Number} depth
*/
function traverse(node, flatList, depth = 1) {
const normNode = {label: node.label};
const normNode = {
id: node.label,
label: node.label,
opacity: node.opacity ?? null,
isMain: node.isMain ?? false,
active: true,
};
if (node.model) {
normNode.model = node.model;
}
@@ -18,9 +24,8 @@ function traverse(node, flatList, depth = 1) {
depth
});
if (node.children) {
depth++;
for(let child of node.children) {
traverse(child, flatList, depth);
traverse(child, flatList, depth + 1);
}
}
}
@@ -32,11 +37,11 @@ function traverse(node, flatList, depth = 1) {
* @returns {Object[]} A flat list of nodes
**/
export function normalizeNodes (nodes) {
let flatNodes = [];
let flatList = [];
for (let node of nodes) {
traverse(node, flatNodes);
traverse(node, flatList);
}
return flatNodes;
return flatList;
}