Fix bug with clipping
This commit is contained in:
2
js/ui.js
2
js/ui.js
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user