MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / forEachLayoutTreeNode

Function forEachLayoutTreeNode

packages/core/src/testing/renderer.ts:266–282  ·  view source on GitHub ↗
(
  layoutTree: LayoutTree,
  mode: TestRendererMode,
  visit: TestRenderLayoutVisitor,
)

Source from the content-addressed store, hash-verified

264}
265
266function 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
284function inClipStack(x: number, y: number, clipStack: readonly ClipRect[]): boolean {
285 for (const clip of clipStack) {

Callers 1

renderFunction · 0.85

Calls 3

asPropsRecordFunction · 0.85
visitFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected