chickadee » sdl2 » enclose-points

enclose-points points #!optional clip result-rectprocedure

See SDL_EnclosePoints.

points must be a list of sdl2:points.

clip must be either an sdl2:rect or #f (the default). If clip is an sdl2:rect, points outside the clip rect will be ignored.

If result-rect is omitted or #f, a new managed sdl2:rect will be returned. If result-rect is an sdl2:rect, it will be modified and returned. It is safe for result-rect to be the same object as clip, in which case clip will be modified and returned.

This procedure returns multiple values:

rect
An sdl2:rect that encloses all matching points. This will be the same object as result-rect, if result-rect was specified.
any-enclosed?
#t if any points were enclosed, or #f if all points were clipped