feat(core): support origin on node level closes #2874

This commit is contained in:
moklick
2023-03-14 12:42:06 +01:00
parent cca25a792b
commit 13e7cc340c
8 changed files with 26 additions and 19 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ function MiniMap({
nodeBorderRadius = 5,
nodeStrokeWidth = 2,
// We need to rename the prop to be `CapitalCase` so that JSX will render it as
// a component properly.
// a component properly.
nodeComponent: NodeComponent = MiniMapNode,
maskColor = 'rgb(240, 240, 240, 0.6)',
maskStrokeColor = 'none',
@@ -181,7 +181,7 @@ function MiniMap({
>
{ariaLabel && <title id={labelledBy}>{ariaLabel}</title>}
{nodes.map((node) => {
const { x, y } = getNodePositionWithOrigin(node, nodeOrigin).positionAbsolute;
const { x, y } = getNodePositionWithOrigin(node, node.origin || nodeOrigin).positionAbsolute;
return (
<NodeComponent