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

Method BBoxes

svg/node.go:419–427  ·  view source on GitHub ↗

ComputeBBox is called by default in render to compute bounding boxes for gui interaction -- can only be done in rendering because that is when all the proper transforms are all in place -- VpBBox is intersected with parent SVG

(sv *SVG)

Source from the content-addressed store, hash-verified

417// gui interaction -- can only be done in rendering because that is when all
418// the proper transforms are all in place -- VpBBox is intersected with parent SVG
419func (g *NodeBase) BBoxes(sv *SVG) {
420 if g.This == nil {
421 return
422 }
423 ni := g.This.(Node)
424 g.BBox = ni.NodeBBox(sv)
425 g.BBox.Canon()
426 g.VisBBox = sv.Geom.SizeRect().Intersect(g.BBox)
427}
428
429// PushTransform checks our bounding box and visibility, returning false if
430// out of bounds. If visible, pushes our transform.

Callers 1

RenderMethod · 0.95

Calls 4

CanonMethod · 0.80
SizeRectMethod · 0.80
NodeBBoxMethod · 0.65
IntersectMethod · 0.45

Tested by

no test coverage detected