def calcPolygonRect(pointArray):
    """ receives a point list and returns the rect that contains them as a tupple -> tuple left, top, right, bottom
    """
    l, t, r, b = 10000000, 10000000, -10000000, -10000000
    for n in pointArray:
        if n[0] < l:
            l = n[0]
        if n[0] > r:
            r = n[0]
        if n[1] < t:
            t = n[1]
        if n[1] > b:
            b = n[1]
    return l, t, r, b
