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

Method clamp

include/math.hpp:454–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452
453
454inline Vec Vec::clamp(Rect bound) const {
455 return Vec(
456 math::clamp(x, bound.pos.x, bound.pos.x + bound.size.x),
457 math::clamp(y, bound.pos.y, bound.pos.y + bound.size.y)
458 );
459}
460
461inline Vec Vec::clampSafe(Rect bound) const {
462 return Vec(

Callers 2

getViewportMethod · 0.45
stepMethod · 0.45

Calls 2

VecClass · 0.85
clampFunction · 0.70

Tested by

no test coverage detected