( current: LayoutDamageRows | null, y: number, height: number, )
| 21 | } |
| 22 | |
| 23 | export function addLayoutDamageRows( |
| 24 | current: LayoutDamageRows | null, |
| 25 | y: number, |
| 26 | height: number, |
| 27 | ): LayoutDamageRows | null { |
| 28 | const next = normalizeRows(y, height) |
| 29 | if (!next) return current |
| 30 | if (!current) return next |
| 31 | |
| 32 | const top = Math.min(current.y, next.y) |
| 33 | const bottom = Math.max(current.y + current.height, next.y + next.height) |
| 34 | return { y: top, height: bottom - top } |
| 35 | } |
| 36 | |
| 37 | export function addLayoutDamageRect( |
| 38 | current: LayoutDamageRows | null, |
no test coverage detected