(prepared: PreparedText, maxWidth: number, lineHeight: number)
| 703 | // - Trailing whitespace hangs past the line edge (doesn't trigger breaks) |
| 704 | // - Segments wider than maxWidth are broken at grapheme boundaries |
| 705 | export function layout(prepared: PreparedText, maxWidth: number, lineHeight: number): LayoutResult { |
| 706 | // Keep the resize hot path specialized. `layoutWithLines()` shares the same |
| 707 | // break semantics but also tracks line ranges; the extra bookkeeping is too |
| 708 | // expensive to pay on every hot-path `layout()` call. |
| 709 | const lineCount = countPreparedLines(getInternalPrepared(prepared), maxWidth) |
| 710 | return { lineCount, height: lineCount * lineHeight } |
| 711 | } |
| 712 | |
| 713 | function createLayoutLine( |
| 714 | prepared: PreparedTextWithSegments, |
no test coverage detected
searching dependent graphs…