MeshCreator.GetBounds C# (CSharp) Method

GetBounds() private static method

private static GetBounds ( IEnumerable poly ) : Rect
poly IEnumerable
return Rect
    private static Rect GetBounds(IEnumerable<Vector2> poly)
    {
        float bx1 = poly.Min(p => p.x);
        float by1 = poly.Min(p => p.y);
        float bx2 = poly.Max(p => p.x);
        float by2 = poly.Max(p => p.y);

        return new Rect(bx1, by1, bx2 - bx1, by2 - by1);
    }