(y: number, totalLines: number)
| 120 | * below the last, and both should read as the line they are adjacent to. |
| 121 | */ |
| 122 | export function lineAtOffset(y: number, totalLines: number): number { |
| 123 | if (totalLines <= 0) return 1; |
| 124 | const line = Math.floor((y - CODE_TOP_PAD) / CODE_LINE_HEIGHT) + 1; |
| 125 | return Math.max(1, Math.min(totalLines, line)); |
| 126 | } |
| 127 | |
| 128 | /** The 1-based lines to render for a scroll position, with overscan. */ |
| 129 | export function visibleLines( |
no outgoing calls
no test coverage detected