Merge pull request #4630 from xyflow/refactor/minimap-init
Refactor/minimap init
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@xyflow/react': patch
|
||||
---
|
||||
|
||||
minimap: use latest node dimensions
|
||||
@@ -79,14 +79,17 @@ function NodeComponentWrapperInner<NodeType extends Node>({
|
||||
onClick: MiniMapNodesProps['onClick'];
|
||||
shapeRendering: string;
|
||||
}) {
|
||||
const { node, x, y } = useStore((s) => {
|
||||
const { node, x, y, width, height } = useStore((s) => {
|
||||
const node = s.nodeLookup.get(id) as InternalNode<NodeType>;
|
||||
const { x, y } = node.internals.positionAbsolute;
|
||||
const { width, height } = getNodeDimensions(node);
|
||||
|
||||
return {
|
||||
node,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
};
|
||||
}, shallow);
|
||||
|
||||
@@ -94,8 +97,6 @@ function NodeComponentWrapperInner<NodeType extends Node>({
|
||||
return null;
|
||||
}
|
||||
|
||||
const { width, height } = getNodeDimensions(node);
|
||||
|
||||
return (
|
||||
<NodeComponent
|
||||
x={x}
|
||||
|
||||
Reference in New Issue
Block a user