/// Returns the smallest rectangle defined by the top/bottom/left/right-most
/// points provided as parameter.
///
/// Note: This function has a behavior that can be surprising because
/// the right-most and bottom-most points are exactly on the edge
/// of the rectangle while the `contains` function is has exclusive
/// semantic on these edges. This means that the right-most and bottom-most
/// points provided to `from_points` will count as not contained by the rect.
/// This behavior may change in the future.
Returns the smallest rectangle defined by the top/bottom/left/right-most
points provided as parameter.

This function has a behavior that can be surprising because
the right-most and bottom-most points are exactly on the edge
of the rectangle while the `contains` function is has exclusive
semantic on these edges. This means that the right-most and bottom-most
points provided to `from_points` will count as not contained by the rect.
This behavior may change in the future.
Returns the smallest rectangle defined by the top / bottom / left / right - most points provided as parameter . This function has a behavior that can be surprising because the right - most and bottom - most points are exactly on the edge of the rectangle while the ` contains ` function is has exclusive semantic on these edges . This means that the right - most and bottom - most points provided to ` from_points ` will count as not contained by the rect . This behavior may change in the future .
pub fn from_points<I>(points: I) -> Self
    where
        I: IntoIterator,
        I::Item: Borrow<Point2D<T, U>>,
    {
        let mut points = points.into_iter();
        let (mut min_x, mut min_y) = match points.next() {
            Some(first) => (first.borrow().x, first.borrow().y),
            None => return Rect::zero(),
        };
        let (mut max_x, mut max_y) = (min_x, min_y);
        for point in points {
            let p = point.borrow();
            if p.x < min_x {
                min_x = p.x
            }
            if p.x > max_x {
                max_x = p.x
            }
            if p.y < min_y {
                min_y = p.y
            }
            if p.y > max_y {
                max_y = p.y
            }
        }
        Rect::new(
            Point2D::new(min_x, min_y),
            Size2D::new(max_x - min_x, max_y - min_y),
        )
    }
pub fn from_points < I > ( points : I ) -> Self where I : IntoIterator , I :: Item : Borrow < Point2D < T , U > > , { let mut points = points . into_iter ( ) ; let ( mut min_x , mut min_y ) = match points . next ( ) { Some ( first ) => ( first . borrow ( ) . x , first . borrow ( ) . y ) , None => return Rect :: zero ( ) , } ; let ( mut max_x , mut max_y ) = ( min_x , min_y ) ; for point in points { let p = point . borrow ( ) ; if p . x < min_x { min_x = p . x } if p . x > max_x { max_x = p . x } if p . y < min_y { min_y = p . y } if p . y > max_y { max_y = p . y } } Rect :: new ( Point2D :: new ( min_x , min_y ) , Size2D :: new ( max_x - min_x , max_y - min_y ) , ) }
Returns the smallest rectangle defined by the top/bottom/left/right-most
points provided as parameter.
Returns the smallest rectangle defined by the top / bottom / left / right - most points provided as parameter .
points
I