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

Method LastFont

paint/span.go:664–681  ·  view source on GitHub ↗

LastFont finds the last font and color from given span

()

Source from the content-addressed store, hash-verified

662
663// LastFont finds the last font and color from given span
664func (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
684func (sr *Span) RenderBg(pc *Context, tpos math32.Vector2) {

Callers 1

SplitAtLRMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected