If p is inside of rect, a copy of p is returned. If p is outside of rect, a point is returned closest to p on the edge of the rectangle.
p
rect
If
p
is inside ofrect
, a copy ofp
is returned. Ifp
is outside ofrect
, a point is returned closest top
on the edge of the rectangle.