| 142 | |
| 143 | |
| 144 | math::Rect Widget::getViewport(math::Rect r) { |
| 145 | math::Rect bound; |
| 146 | if (parent) { |
| 147 | bound = parent->getViewport(box); |
| 148 | } |
| 149 | else { |
| 150 | bound = box; |
| 151 | } |
| 152 | bound.pos = bound.pos.minus(box.pos); |
| 153 | return r.clamp(bound); |
| 154 | } |
| 155 | |
| 156 | |
| 157 | bool Widget::hasChild(Widget* child) { |