MCPcopy Create free account
hub / github.com/Noumena-Network/code / normalizeRows

Function normalizeRows

src/ink/layoutDamageRows.ts:8–21  ·  view source on GitHub ↗
(
  y: number,
  height: number,
)

Source from the content-addressed store, hash-verified

6}
7
8function normalizeRows(
9 y: number,
10 height: number,
11): LayoutDamageRows | null {
12 if (!Number.isFinite(y) || !Number.isFinite(height) || height <= 0) {
13 return null
14 }
15 const top = Math.floor(y)
16 const bottom = Math.ceil(y + height)
17 if (!Number.isFinite(top) || !Number.isFinite(bottom) || bottom <= top) {
18 return null
19 }
20 return { y: top, height: bottom - top }
21}
22
23export function addLayoutDamageRows(
24 current: LayoutDamageRows | null,

Callers 1

addLayoutDamageRowsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected