def METHOD_NAME(extent):
    min_viewport = settings.ENHYDRIS_MAP_MIN_VIEWPORT_SIZE
    dx = abs(extent[2] - extent[0])
    if dx < min_viewport:
        extent[2] += 0.5 * (min_viewport - dx)
        extent[0] -= 0.5 * (min_viewport - dx)
    dy = abs(extent[3] - extent[1])
    if dy < min_viewport:
        extent[3] += 0.5 * (min_viewport - dy)
        extent[1] -= 0.5 * (min_viewport - dy)