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

Method intersect

include/math.hpp:410–417  ·  view source on GitHub ↗

Returns the intersection of `this` and `b`. */

Source from the content-addressed store, hash-verified

408 }
409 /** Returns the intersection of `this` and `b`. */
410 Rect intersect(Rect b) const {
411 Rect r;
412 r.pos.x = std::fmax(pos.x, b.pos.x);
413 r.pos.y = std::fmax(pos.y, b.pos.y);
414 r.size.x = std::fmin(pos.x + size.x, b.pos.x + b.size.x) - r.pos.x;
415 r.size.y = std::fmin(pos.y + size.y, b.pos.y + b.size.y) - r.pos.y;
416 return r;
417 }
418 /** Returns a Rect with its position set to zero. */
419 Rect zeroPos() const {
420 return Rect(Vec(), size);

Callers 2

renderMethod · 0.80
drawChildMethod · 0.80

Calls 2

fmaxFunction · 0.85
fminFunction · 0.85

Tested by

no test coverage detected