fixed useConnection hook, made derivedWarnings more specific, fixed updating when internals change
This commit is contained in:
@@ -337,10 +337,13 @@ export function updateNodeInternals<NodeType extends InternalNodeBase>(
|
||||
}
|
||||
|
||||
if (node.hidden) {
|
||||
node.internals = {
|
||||
...node.internals,
|
||||
handleBounds: undefined,
|
||||
};
|
||||
nodeLookup.set(node.id, {
|
||||
...node,
|
||||
internals: {
|
||||
...node.internals,
|
||||
handleBounds: undefined,
|
||||
},
|
||||
});
|
||||
updatedInternals = true;
|
||||
} else {
|
||||
const dimensions = getDimensions(update.nodeElement);
|
||||
@@ -362,15 +365,19 @@ export function updateNodeInternals<NodeType extends InternalNodeBase>(
|
||||
positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);
|
||||
}
|
||||
|
||||
node.measured = dimensions;
|
||||
node.internals = {
|
||||
...node.internals,
|
||||
positionAbsolute,
|
||||
handleBounds: {
|
||||
source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id),
|
||||
target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id),
|
||||
nodeLookup.set(node.id, {
|
||||
...node,
|
||||
measured: dimensions,
|
||||
internals: {
|
||||
...node.internals,
|
||||
positionAbsolute,
|
||||
handleBounds: {
|
||||
source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id),
|
||||
target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id),
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
if (node.parentId) {
|
||||
updateChildNode(node, nodeLookup, parentLookup, { nodeOrigin });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user