The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ConfinePointToRect


Unit: SDL_math1
Class: None
Declaration: function ConfinePointToRect (var Point: TPointDouble; BoundRect: TRectDouble): boolean;

The function ConfinePointToRect checks whether the two-dimensional position Point is outside the rectangle specified by the parameter BoundRect. If Point falls outside the rectangle the function adjusts the point coordinates to the closest edge(s) of the rectangle. In this case a TRUE value is returned.

Hint: The order of the rectangle coordinates do not matter (i.e. the function works correctly even if the Left and Right, or the Top and Bottom parameters of the boundary have been exchanged).



Last Update: 2023-Feb-06