def calculate_border(grid_dims, width, height):
    """Calculate each line in all borders.

    Args:
        grid_dims: tuple of the number of tiles in grid. In format `(row, column)`
        width: float width in pixels
        height: float height in pixels

    Returns:
        list: containing dictionaries keys `(x, y)` and values for the two points for each line in grid

    """
    return [
        {
            'x': [c_idx * width] * 2,
            'y': [0, height * grid_dims[0]],
        } for c_idx in range(grid_dims[1] + 1)
    ] + [
        {
            'x': [0, width * grid_dims[1]],
            'y': [r_idx * height] * 2,
        } for r_idx in range(grid_dims[0] + 1)
    ]