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

Method Render

svg/text.go:190–214  ·  view source on GitHub ↗
(sv *SVG)

Source from the content-addressed store, hash-verified

188}
189
190func (g *Text) Render(sv *SVG) {
191 if g.IsParText() {
192 pc := &g.Paint
193 rs := &sv.RenderState
194 rs.PushTransform(pc.Transform)
195
196 g.RenderChildren(sv)
197 g.BBoxes(sv) // must come after render
198
199 rs.PopTransform()
200 } else {
201 vis, rs := g.PushTransform(sv)
202 if !vis {
203 return
204 }
205 if len(g.Text) > 0 {
206 g.RenderText(sv)
207 }
208 g.RenderChildren(sv)
209 if g.IsParText() {
210 g.BBoxes(sv) // after kids have rendered
211 }
212 rs.PopTransform()
213 }
214}
215
216// ApplyTransform applies the given 2D transform to the geometry of this node
217// each node must define this for itself

Callers 1

RenderMethod · 0.95

Calls 6

IsParTextMethod · 0.95
RenderTextMethod · 0.95
PopTransformMethod · 0.80
BBoxesMethod · 0.65
PushTransformMethod · 0.45
RenderChildrenMethod · 0.45

Tested by

no test coverage detected