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

Function buildLayoutDebugOverlay

packages/core/src/app/createApp/renderLoop.ts:108–129  ·  view source on GitHub ↗
(rectById: ReadonlyMap<string, Rect>)

Source from the content-addressed store, hash-verified

106}
107
108function buildLayoutDebugOverlay(rectById: ReadonlyMap<string, Rect>): VNode | null {
109 if (rectById.size === 0) return null;
110 const rows = [...rectById.entries()]
111 .sort((a, b) => a[0].localeCompare(b[0]))
112 .slice(0, 18)
113 .map(([id, rect]) =>
114 ui.text(`${id} ${String(rect.x)},${String(rect.y)} ${String(rect.w)}x${String(rect.h)}`),
115 );
116 const panel = ui.box({ border: "single", title: `Layout (${String(rectById.size)})`, p: 1 }, [
117 ui.column({ gap: 0 }, rows),
118 ]);
119 return ui.layer({
120 id: "rezi.layout.debug.overlay",
121 zIndex: 2_000_000_000,
122 modal: false,
123 backdrop: "none",
124 closeOnEscape: false,
125 content: ui.column({ width: "full", height: "full", justify: "end", p: 1 }, [
126 ui.row({ width: "full", justify: "start" }, [panel]),
127 ]),
128 });
129}
130
131function blendThemeColors(from: Theme, to: Theme, t: number): Theme {
132 return blendTheme(from, to, t);

Callers 1

tryRenderOnceFunction · 0.85

Calls 1

entriesMethod · 0.45

Tested by

no test coverage detected