LastFont finds the last font and color from given span
()
| 662 | |
| 663 | // LastFont finds the last font and color from given span |
| 664 | func (sr *Span) LastFont() (face font.Face, color image.Image) { |
| 665 | for i := len(sr.Render) - 1; i >= 0; i-- { |
| 666 | srr := sr.Render[i] |
| 667 | if face == nil && srr.Face != nil { |
| 668 | face = srr.Face |
| 669 | if face != nil && color != nil { |
| 670 | break |
| 671 | } |
| 672 | } |
| 673 | if color == nil && srr.Color != nil { |
| 674 | color = srr.Color |
| 675 | if face != nil && color != nil { |
| 676 | break |
| 677 | } |
| 678 | } |
| 679 | } |
| 680 | return |
| 681 | } |
| 682 | |
| 683 | // RenderBg renders the background behind chars |
| 684 | func (sr *Span) RenderBg(pc *Context, tpos math32.Vector2) { |