Documentation
¶
Overview ¶
Package hit provides compositor-based mouse hit-testing for the TUI's pages and dialogs. Each clickable region is a lipgloss v2 Layer with an ID placed at its drawn location; lipgloss.Compositor.Hit resolves a point to the top-most region and its bounds, from which a handler derives the in-region offset. This replaces the hand-rolled point-in-rectangle geometry the pages used to keep in sync with the renderer, so a mouse coordinate is hit-tested against the layers once rather than double-managed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map wraps a lipgloss.Compositor of ID'd region layers. A nil Map (or one built with no regions) simply never hits, so callers need not guard for a page that has not rendered yet.
func New ¶
New builds a Map from region layers (typically produced by Region). Regions may overlap: a higher Z region wins the hit, so a sub-region (e.g. a history band inside a detail pane) is placed above the pane it sits in.