Fix origin not being respected, when calulating rect
This commit is contained in:
@@ -55,11 +55,10 @@ export function useReactFlow<NodeType extends Node = Node, EdgeType extends Edge
|
|||||||
: nodeToUse.position;
|
: nodeToUse.position;
|
||||||
|
|
||||||
const nodeWithPosition = {
|
const nodeWithPosition = {
|
||||||
id: nodeToUse.id,
|
...nodeToUse,
|
||||||
position,
|
position,
|
||||||
width: nodeToUse.measured?.width ?? nodeToUse.width,
|
width: nodeToUse.measured?.width ?? nodeToUse.width,
|
||||||
height: nodeToUse.measured?.height ?? nodeToUse.height,
|
height: nodeToUse.measured?.height ?? nodeToUse.height,
|
||||||
data: nodeToUse.data,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return nodeToRect(nodeWithPosition);
|
return nodeToRect(nodeWithPosition);
|
||||||
|
|||||||
@@ -293,11 +293,10 @@ export function useSvelteFlow(): {
|
|||||||
: nodeToUse.position;
|
: nodeToUse.position;
|
||||||
|
|
||||||
const nodeWithPosition = {
|
const nodeWithPosition = {
|
||||||
id: nodeToUse.id,
|
...nodeToUse,
|
||||||
position,
|
position,
|
||||||
width: nodeToUse.measured?.width ?? nodeToUse.width,
|
width: nodeToUse.measured?.width ?? nodeToUse.width,
|
||||||
height: nodeToUse.measured?.height ?? nodeToUse.height,
|
height: nodeToUse.measured?.height ?? nodeToUse.height
|
||||||
data: nodeToUse.data
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return nodeToRect(nodeWithPosition);
|
return nodeToRect(nodeWithPosition);
|
||||||
|
|||||||
Reference in New Issue
Block a user