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

Method RuneEndPos

paint/span.go:127–134  ·  view source on GitHub ↗

RuneEndPos returns the relative ending position of the given rune index (adds Span RelPos and rune RelPos + rune Size.X for LR writing). If index > length, then uses LastPos

(idx int)

Source from the content-addressed store, hash-verified

125// (adds Span RelPos and rune RelPos + rune Size.X for LR writing). If index >
126// length, then uses LastPos
127func (sr *Span) RuneEndPos(idx int) math32.Vector2 {
128 if idx >= len(sr.Render) {
129 return sr.LastPos
130 }
131 spos := sr.RelPos.Add(sr.Render[idx].RelPos)
132 spos.X += sr.Render[idx].Size.X
133 return spos
134}
135
136// AppendRune adds one rune and associated formatting info
137func (sr *Span) HasDecoUpdate(bg image.Image, deco styles.TextDecorations) {

Callers 1

charEndPosMethod · 0.45

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected