Documentation
¶
Overview ¶
Package overlay composites a floating block of text over already-rendered lines without changing their number.
It is the mechanism a dropdown needs and nothing more: the modal layout engine uses it to paint a Combo's list over the sections underneath, and the Configuration surface uses it to paint a select control's list over the page behind it. Both want the same thing — "draw this rectangle on top, clip it to what is already there" — so both call the same code rather than each carrying a copy of the cell arithmetic that ANSI-aware slicing requires.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Composite ¶
Composite draws over onto base at (x, y), measured in cells from base's top left. It never adds, removes, or lengthens lines: anything that would fall outside base is clipped, so a caller's height contract is unaffected.
func Line ¶
Line draws over onto one line of base starting at cell x. A negative x clips the left of over rather than shifting it, and a base line shorter than x is padded with spaces so the overlay still lands where it was asked to.
Everything here is measured in cells, not runes or bytes: a base line carrying SGR sequences must not have them counted as width, and a wide rune the overlay only half-covers is replaced by a space rather than allowed to shift the rest of the line sideways. An overlay that fits inside the base leaves the line exactly as wide as it found it.
Types ¶
This section is empty.