| 708 | * previous physical row may contain stale non-space glyphs. |
| 709 | */ |
| 710 | export 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 | |
| 734 | export function hasVisibleCellAt(screen: Screen, x: number, y: number): boolean { |
| 735 | if (x < 0 || y < 0 || x >= screen.width || y >= screen.height) { |