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

Function skippedContentSpaceStyleIdAt

src/ink/screen.ts:710–732  ·  view source on GitHub ↗
(
  cells: Int32Array,
  index: number,
  lastRenderedStyleId: number,
)

Source from the content-addressed store, hash-verified

708 * previous physical row may contain stale non-space glyphs.
709 */
710export function skippedContentSpaceStyleIdAt(
711 cells: Int32Array,
712 index: number,
713 lastRenderedStyleId: number,
714): number | undefined {
715 const ci = index << 1
716 if (cells[ci] !== 0) {
717 return undefined
718 }
719
720 const word1 = cells[ci + 1]!
721 if ((word1 & WIDTH_MASK) !== CellWidth.Narrow) {
722 return undefined
723 }
724 if ((word1 & 0x3fffc) !== 0) {
725 return undefined
726 }
727
728 const fgStyle = word1 >>> STYLE_SHIFT
729 return fgStyle === 0 || fgStyle === lastRenderedStyleId
730 ? fgStyle
731 : undefined
732}
733
734export function hasVisibleCellAt(screen: Screen, x: number, y: number): boolean {
735 if (x < 0 || y < 0 || x >= screen.width || y >= screen.height) {

Callers 1

renderFrameSliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected