chore(rootIndex): start with 1

This commit is contained in:
moklick
2025-12-02 17:15:46 +01:00
parent 0c7261a6dc
commit 7ef3ffadf6

View File

@@ -128,12 +128,11 @@ export function adoptUserNodes<NodeType extends NodeBase>(
options: UpdateNodesOptions<NodeType> = {}
): boolean {
const _options = mergeObjects(adoptUserNodesDefaultOptions, options);
const rootParentIndex = { i: -1 };
let nodesInitialized = nodes.length > 0;
const rootParentIndex = { i: 0 };
const tmpLookup = new Map(nodeLookup);
const selectedNodeZ: number =
_options?.elevateNodesOnSelect && !isManualZIndexMode(_options.zIndexMode) ? SELECTED_NODE_Z : 0;
let nodesInitialized = nodes.length > 0;
nodeLookup.clear();
parentLookup.clear();