MCPcopy Create free account
hub / github.com/VCVRack/Rack / getVisibleChildrenBoundingBox

Method getVisibleChildrenBoundingBox

src/widget/Widget.cpp:102–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101
102math::Rect Widget::getVisibleChildrenBoundingBox() {
103 math::Vec min = math::Vec(INFINITY, INFINITY);
104 math::Vec max = math::Vec(-INFINITY, -INFINITY);
105 for (Widget* child : children) {
106 if (!child->isVisible())
107 continue;
108 min = min.min(child->box.getTopLeft());
109 max = max.max(child->box.getBottomRight());
110 }
111 return math::Rect::fromMinMax(min, max);
112}
113
114
115bool Widget::isDescendantOf(Widget* ancestor) {

Callers 2

stepMethod · 0.80
onHoverKeyMethod · 0.80

Calls 6

VecClass · 0.85
isVisibleMethod · 0.80
getTopLeftMethod · 0.80
getBottomRightMethod · 0.80
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected