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

Function rowHasVisibleContentInRange

src/ink/log-update.ts:1567–1609  ·  view source on GitHub ↗
(
  frame: Frame,
  row: number,
  fromX: number,
  toX: number,
)

Source from the content-addressed store, hash-verified

1565}
1566
1567function rowHasVisibleContentInRange(
1568 frame: Frame,
1569 row: number,
1570 fromX: number,
1571 toX: number,
1572): boolean {
1573 if (row < 0 || row >= frame.screen.height || fromX >= toX) {
1574 return false
1575 }
1576
1577 const { width, cells, charPool, hyperlinkPool } = frame.screen
1578 const rowStart = row * width
1579 let lastRenderedStyleId = -1
1580 const scratchCell: Cell = {
1581 char: ' ',
1582 styleId: 0,
1583 width: CellWidth.Narrow,
1584 hyperlink: undefined,
1585 }
1586
1587 for (let x = 0; x < toX; x += 1) {
1588 if (
1589 !visibleCellAtIndexInto(
1590 cells,
1591 charPool,
1592 hyperlinkPool,
1593 rowStart + x,
1594 lastRenderedStyleId,
1595 scratchCell,
1596 )
1597 ) {
1598 continue
1599 }
1600 const cell = scratchCell
1601
1602 if (x >= fromX) {
1603 return true
1604 }
1605 lastRenderedStyleId = cell.styleId
1606 }
1607
1608 return false
1609}
1610
1611function shouldOverwriteSkippedRepaintSpace(
1612 previousFrame: Frame | undefined,

Callers 4

renderMethod · 0.85

Calls 1

visibleCellAtIndexIntoFunction · 0.85

Tested by

no test coverage detected