chore(example): add debug node

This commit is contained in:
moklick
2021-11-08 17:55:02 +01:00
parent 9057d3ab75
commit b0bfefeef4
5 changed files with 77 additions and 24 deletions
+1 -7
View File
@@ -55,7 +55,7 @@ export function createNodeInternals(nodes: Node[], nodeInternals: NodeInternals)
const positionAbsoluteAndTreeLevel = getAbsolutePosAndTreeLevel(node, nextNodeInternals, {
...node.position,
treeLevel: node.zIndex || updatedInternals?.treeLevel || parentNodeInternal?.treeLevel || 0,
treeLevel: updatedInternals.treeLevel || parentNodeInternal?.treeLevel || 0,
});
const { treeLevel, x, y } = positionAbsoluteAndTreeLevel;
@@ -67,12 +67,6 @@ export function createNodeInternals(nodes: Node[], nodeInternals: NodeInternals)
};
updatedInternals.treeLevel = treeLevel;
}
// if (node.isDragging || node.isSelected) {
// nextNodeInternals.set(node.id, { ...updatedInternals, treeLevel: 1000 });
// } else {
// nextNodeInternals.set(node.id, { ...updatedInternals, treeLevel: updatedInternals?.treeLevel || 0 });
// }
});
return nextNodeInternals;