( layoutTree: LayoutTree, mode: TestRendererMode, visit: TestRenderLayoutVisitor, )
| 264 | } |
| 265 | |
| 266 | function forEachLayoutTreeNode( |
| 267 | layoutTree: LayoutTree, |
| 268 | mode: TestRendererMode, |
| 269 | visit: TestRenderLayoutVisitor, |
| 270 | ): void { |
| 271 | const stack: LayoutTree[] = [layoutTree]; |
| 272 | while (stack.length > 0) { |
| 273 | const node = stack.pop(); |
| 274 | if (!node) continue; |
| 275 | const props = asPropsRecord((node.vnode as { props?: unknown }).props, mode); |
| 276 | visit(node.rect, props); |
| 277 | for (let index = node.children.length - 1; index >= 0; index -= 1) { |
| 278 | const child = node.children[index]; |
| 279 | if (child) stack.push(child); |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | function inClipStack(x: number, y: number, clipStack: readonly ClipRect[]): boolean { |
| 285 | for (const clip of clipStack) { |
no test coverage detected