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

Method getViewport

src/widget/Widget.cpp:144–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142
143
144math::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
157bool Widget::hasChild(Widget* child) {

Callers

nothing calls this directly

Calls 2

minusMethod · 0.80
clampMethod · 0.45

Tested by

no test coverage detected