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)
| 115 | // position where rendering will start, not the upper left corner. if index > |
| 116 | // length, then uses LastPos |
| 117 | func (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 > |
no test coverage detected