| 100 | |
| 101 | |
| 102 | math::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 | |
| 115 | bool Widget::isDescendantOf(Widget* ancestor) { |
no test coverage detected