TextRuns#
func (snapshot Snapshot) TextRuns(text ui.Text) []ui.TextRunTextRuns returns the runs of one of the snapshot's Texts.
API 文档由 Go 源码生成,内容为英文。
type Snapshot struct {
Title string
Width, Height int
Clear Color
Primitives []Primitive
Labels []Label
// Editor is nil unless a text field is being edited natively.
Editor *Editor
// Texts is every text the application painted this frame, before clipping,
// for queries; Labels holds what is actually drawn.
Texts []ui.Text
// Runs are the text runs Texts refer to; see TextRuns.
Runs []ui.TextRun
Hits []ui.Hit
// Tree is the identity tree the hits are named in, for printing them.
Tree *ui.Tree
// Focused and Hovered are hit identities (0 for none).
Focused ui.ID
Hovered ui.ID
Cursor Cursor
Now time.Duration
}Snapshot is everything visible and interactive at one moment.
TextRuns#func (snapshot Snapshot) TextRuns(text ui.Text) []ui.TextRunTextRuns returns the runs of one of the snapshot's Texts.