Rect::Clamp

Rect::Clamp
inline Rect<T>& Clamp(const Rect<T> & r);
inline Rect<T>& Clamp(T l, T t, T r, T b);
Description

Clamp clamps the local rectangle with a passed rectangle by comparing their components. The greater x1 and y1, and lesser x2 and y2 components are chosen.

Parameters
Parameters 
Description 
const Rect<T> & r 
Either the value that is compared to x2 or a passed rectangle whose x1, y1, x2, and y2 components are compared to those of the local rectangle respectively. 
T l 
A value that is compared to the x1 component of the local rectangle. 
T t 
A value that is compared to the y1 component of the local rectangle. 
T b 
A value that is compared to the y2 component of the local rectangle. 
T r 
A value that is compared to the x2 component of the local rectangle. 
Return Value

A new Rect whose components represent the clamped values of a local rectangle. The values were determined by comparing the rectangle to a passed Rect. The greater x1 and y1, and lesser x2 and y2 components were chosen.