(node: InternalNodeBase | NodeBase, nodeOrigin: NodeOrigin = [0, 0])
| 98 | }); |
| 99 | |
| 100 | export const nodeToRect = (node: InternalNodeBase | NodeBase, nodeOrigin: NodeOrigin = [0, 0]): Rect => { |
| 101 | const { x, y } = isInternalNodeBase(node) |
| 102 | ? node.internals.positionAbsolute |
| 103 | : getNodePositionWithOrigin(node, nodeOrigin); |
| 104 | |
| 105 | return { |
| 106 | x, |
| 107 | y, |
| 108 | width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0, |
| 109 | height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0, |
| 110 | }; |
| 111 | }; |
| 112 | |
| 113 | export const nodeToBox = (node: InternalNodeBase | NodeBase, nodeOrigin: NodeOrigin = [0, 0]): Box => { |
| 114 | const { x, y } = isInternalNodeBase(node) |
no test coverage detected