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)
| 125 | // (adds Span RelPos and rune RelPos + rune Size.X for LR writing). If index > |
| 126 | // length, then uses LastPos |
| 127 | func (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 |
| 137 | func (sr *Span) HasDecoUpdate(bg image.Image, deco styles.TextDecorations) { |