fix(handles): calc offset correctly
This commit is contained in:
@@ -77,6 +77,7 @@ const DnDFlow = () => {
|
|||||||
onInit={onInit}
|
onInit={onInit}
|
||||||
onDrop={onDrop}
|
onDrop={onDrop}
|
||||||
onDragOver={onDragOver}
|
onDragOver={onDragOver}
|
||||||
|
nodeOrigin={nodeOrigin}
|
||||||
>
|
>
|
||||||
<Controls />
|
<Controls />
|
||||||
</ReactFlow>
|
</ReactFlow>
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ export const getHandleBounds = (
|
|||||||
const handlesArray = Array.from(handles) as HTMLDivElement[];
|
const handlesArray = Array.from(handles) as HTMLDivElement[];
|
||||||
|
|
||||||
const nodeOffset = {
|
const nodeOffset = {
|
||||||
x: nodeBounds.left - nodeBounds.width * nodeOrigin[0],
|
x: nodeBounds.left + nodeBounds.width * nodeOrigin[0],
|
||||||
y: nodeBounds.top - nodeBounds.height * nodeOrigin[1],
|
y: nodeBounds.top + nodeBounds.height * nodeOrigin[1],
|
||||||
};
|
};
|
||||||
|
|
||||||
return handlesArray.map((handle): HandleElement => {
|
return handlesArray.map((handle): HandleElement => {
|
||||||
|
|||||||
Reference in New Issue
Block a user