chore(nodeOriginHelper): cleanup
This commit is contained in:
@@ -156,19 +156,18 @@ export const getNodePositionWithOrigin = (
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const position: XYPosition = {
|
const offset: XYPosition = {
|
||||||
x: node.position.x - (node.width ?? 0) * nodeOrigin[0],
|
x: (node.width ?? 0) * nodeOrigin[0],
|
||||||
y: node.position.y - (node.height ?? 0) * nodeOrigin[1],
|
y: (node.height ?? 0) * nodeOrigin[1],
|
||||||
};
|
|
||||||
|
|
||||||
const positionAbsolute: XYPosition = {
|
|
||||||
x: (node.positionAbsolute?.x ?? 0) - (node.width ?? 0) * nodeOrigin[0],
|
|
||||||
y: (node.positionAbsolute?.y ?? 0) - (node.height ?? 0) * nodeOrigin[1],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...position,
|
x: node.position.x - offset.x,
|
||||||
positionAbsolute,
|
y: node.position.y - offset.y,
|
||||||
|
positionAbsolute: {
|
||||||
|
x: (node.positionAbsolute?.x ?? 0) - offset.x,
|
||||||
|
y: (node.positionAbsolute?.y ?? 0) - offset.y,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user