overlay

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Composite(base, over string, x, y int) string

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

func Line(base, over string, x int) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL