| 1469 | * only getSelectedText/applySelectionOverlay which read it directly. |
| 1470 | */ |
| 1471 | export function markNoSelectRegion( |
| 1472 | screen: Screen, |
| 1473 | x: number, |
| 1474 | y: number, |
| 1475 | width: number, |
| 1476 | height: number, |
| 1477 | ): void { |
| 1478 | const maxX = Math.min(x + width, screen.width) |
| 1479 | const maxY = Math.min(y + height, screen.height) |
| 1480 | const noSel = screen.noSelect |
| 1481 | const stride = screen.width |
| 1482 | for (let row = Math.max(0, y); row < maxY; row++) { |
| 1483 | const rowStart = row * stride |
| 1484 | noSel.fill(1, rowStart + Math.max(0, x), rowStart + maxX) |
| 1485 | } |
| 1486 | } |
| 1487 | |