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

Method expand

include/math.hpp:401–408  ·  view source on GitHub ↗

Returns the bounding box of the union of `this` and `b`. */

Source from the content-addressed store, hash-verified

399 }
400 /** Returns the bounding box of the union of `this` and `b`. */
401 Rect expand(Rect b) const {
402 Rect r;
403 r.pos.x = std::fmin(pos.x, b.pos.x);
404 r.pos.y = std::fmin(pos.y, b.pos.y);
405 r.size.x = std::fmax(pos.x + size.x, b.pos.x + b.size.x) - r.pos.x;
406 r.size.y = std::fmax(pos.y + size.y, b.pos.y + b.size.y) - r.pos.y;
407 return r;
408 }
409 /** Returns the intersection of `this` and `b`. */
410 Rect intersect(Rect b) const {
411 Rect r;

Callers 1

stepMethod · 0.80

Calls 2

fminFunction · 0.85
fmaxFunction · 0.85

Tested by

no test coverage detected