def point_within(point, a_rect):
    """ point_within([x,y], rectstyle) -> true if a point is within the rect.
    """

    x,y,w,h = a_rect

    px, py = point[:2]

    if px < x:
        return 0
    if px > x + w:
        return 0
    
    if py < y:
        return 0
    if py > y + h:
        return 0

    return 1