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

Method PushTransform

svg/node.go:432–456  ·  view source on GitHub ↗

PushTransform checks our bounding box and visibility, returning false if out of bounds. If visible, pushes our transform. Must be called as first step in Render.

(sv *SVG)

Source from the content-addressed store, hash-verified

430// out of bounds. If visible, pushes our transform.
431// Must be called as first step in Render.
432func (g *NodeBase) PushTransform(sv *SVG) (bool, *paint.Context) {
433 g.BBox = image.Rectangle{}
434 if g.Paint.Off || g == nil || g.This == nil {
435 return false, nil
436 }
437 ni := g.This.(Node)
438 // if g.IsInvisible() { // just the Invisible flag
439 // return false, nil
440 // }
441 lbb := ni.LocalBBox()
442 g.BBox = g.LocalBBoxToWin(lbb)
443 g.VisBBox = sv.Geom.SizeRect().Intersect(g.BBox)
444 nvis := g.VisBBox == image.Rectangle{}
445 // g.SetInvisibleState(nvis) // don't set
446
447 if nvis && !g.isDef {
448 return false, nil
449 }
450
451 rs := &sv.RenderState
452 rs.PushTransform(g.Paint.Transform)
453
454 pc := &paint.Context{rs, &g.Paint}
455 return true, pc
456}
457
458func (g *NodeBase) RenderChildren(sv *SVG) {
459 for _, kid := range g.Children {

Callers 12

RenderMethod · 0.95
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45
RenderMethod · 0.45

Calls 4

LocalBBoxToWinMethod · 0.95
SizeRectMethod · 0.80
LocalBBoxMethod · 0.65
IntersectMethod · 0.45

Tested by

no test coverage detected