third_party/cairo/src/cairo-boxes.c
void
_cairo_boxes_limit (cairo_boxes_t	*boxes,
		    const cairo_box_t	*limits,
		    int			 num_limits)
{
    int n;

    boxes->limits = limits;
    boxes->num_limits = num_limits;

    if (boxes->num_limits) {
	boxes->limit = limits[0];
	for (n = 1; n < num_limits; n++) {
	    if (limits[n].p1.x < boxes->limit.p1.x)
		boxes->limit.p1.x = limits[n].p1.x;

	    if (limits[n].p1.y < boxes->limit.p1.y)
		boxes->limit.p1.y = limits[n].p1.y;

	    if (limits[n].p2.x > boxes->limit.p2.x)
		boxes->limit.p2.x = limits[n].p2.x;

	    if (limits[n].p2.y > boxes->limit.p2.y)
		boxes->limit.p2.y = limits[n].p2.y;
	}
    }
}
/** _cairo_boxes_limit:
 *
 * Computes the minimum bounding box of the given list of boxes and assign
 * it to the given boxes set. It also assigns that list as the list of
 * limiting boxes in the box set.
 *
 * @param boxes        the box set to be filled (return buffer)
 * @param limits       array of the limiting boxes to compute the bounding
 *                     box from
 * @param num_limits   length of the limits array
 */
Computes the minimum bounding box of the given list of boxes and assign
it to the given boxes set. It also assigns that list as the list of
limiting boxes in the box set.

@param boxes        the box set to be filled (return buffer)
@param limits       array of the limiting boxes to compute the bounding
box from
@param num_limits   length of the limits array
Computes the minimum bounding box of the given list of boxes and assign it to the given boxes set . It also assigns that list as the list of limiting boxes in the box set . @param boxes the box set to be filled ( return buffer ) @param limits array of the limiting boxes to compute the bounding box from @param num_limits length of the limits array
void
_cairo_boxes_limit (cairo_boxes_t	*boxes,
		    const cairo_box_t	*limits,
		    int			 num_limits)
{
    int n;
    boxes->limits = limits;
    boxes->num_limits = num_limits;
    if (boxes->num_limits) {
	boxes->limit = limits[0];
	for (n = 1; n < num_limits; n++) {
	    if (limits[n].p1.x < boxes->limit.p1.x)
		boxes->limit.p1.x = limits[n].p1.x;
	    if (limits[n].p1.y < boxes->limit.p1.y)
		boxes->limit.p1.y = limits[n].p1.y;
	    if (limits[n].p2.x > boxes->limit.p2.x)
		boxes->limit.p2.x = limits[n].p2.x;
	    if (limits[n].p2.y > boxes->limit.p2.y)
		boxes->limit.p2.y = limits[n].p2.y;
	}
    }
}
void _cairo_boxes_limit ( cairo_boxes_t * boxes , const cairo_box_t * limits , int num_limits ) { int n ; boxes -> limits = limits ; boxes -> num_limits = num_limits ; if ( boxes -> num_limits ) { boxes -> limit = limits [ 0 ] ; for ( n = 1 ; n < num_limits ; n ++ ) { if ( limits [ n ] . p1 . x < boxes -> limit . p1 . x ) boxes -> limit . p1 . x = limits [ n ] . p1 . x ; if ( limits [ n ] . p1 . y < boxes -> limit . p1 . y ) boxes -> limit . p1 . y = limits [ n ] . p1 . y ; if ( limits [ n ] . p2 . x > boxes -> limit . p2 . x ) boxes -> limit . p2 . x = limits [ n ] . p2 . x ; if ( limits [ n ] . p2 . y > boxes -> limit . p2 . y ) boxes -> limit . p2 . y = limits [ n ] . p2 . y ; } } }
_cairo_boxes_limit:
 Computes the minimum bounding box of the given list of boxes and assign
 it to the given boxes set.
_cairo_boxes_limit : Computes the minimum bounding box of the given list of boxes and assign it to the given boxes set .