| 1837 | * only getSelectedText/applySelectionOverlay which read it directly. |
| 1838 | */ |
| 1839 | export function markNoSelectRegion( |
| 1840 | screen: Screen, |
| 1841 | x: number, |
| 1842 | y: number, |
| 1843 | width: number, |
| 1844 | height: number, |
| 1845 | ): void { |
| 1846 | const maxX = Math.min(x + width, screen.width) |
| 1847 | const maxY = Math.min(y + height, screen.height) |
| 1848 | const noSel = screen.noSelect |
| 1849 | const stride = screen.width |
| 1850 | for (let row = Math.max(0, y); row < maxY; row++) { |
| 1851 | const rowStart = row * stride |
| 1852 | noSel.fill(1, rowStart + Math.max(0, x), rowStart + maxX) |
| 1853 | } |
| 1854 | } |