| 21 | } |
| 22 | |
| 23 | export function getNodePositionInGroup(node: Node, containerNode: Node) { |
| 24 | const nodePosition = node.positionAbsolute ?? node.position ?? { x: 0, y: 0 }; |
| 25 | console.log("real node Position", nodePosition, node.position, node.positionAbsolute); |
| 26 | nodePosition.x = nodePosition.x - containerNode.position.x; |
| 27 | nodePosition.y = nodePosition.y - containerNode.position.y; |
| 28 | |
| 29 | return nodePosition; |
| 30 | } |
| 31 | |
| 32 | export function getNodePositionOutOfGroup(node: Node, containerNode: Node) { |
| 33 | const nodePosition = node.position ?? { x: 0, y: 0 }; |