MCPcopy Create free account
hub / github.com/cogentcore/core / RuneRelPos

Method RuneRelPos

paint/span.go:117–122  ·  view source on GitHub ↗

RuneRelPos returns the relative (starting) position of the given rune index (adds Span RelPos and rune RelPos) -- this is typically the baseline position where rendering will start, not the upper left corner. if index > length, then uses LastPos

(idx int)

Source from the content-addressed store, hash-verified

115// position where rendering will start, not the upper left corner. if index >
116// length, then uses LastPos
117func (sr *Span) RuneRelPos(idx int) math32.Vector2 {
118 if idx >= len(sr.Render) {
119 return sr.LastPos
120 }
121 return sr.RelPos.Add(sr.Render[idx].RelPos)
122}
123
124// RuneEndPos returns the relative ending position of the given rune index
125// (adds Span RelPos and rune RelPos + rune Size.X for LR writing). If index >

Callers 2

charPosMethod · 0.45
charStartPosMethod · 0.45

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected