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