def get_bbox(map_dim, sprite_dim, sprite_pos):
    """Returns the bounding box for a sprite that was pasted at position pos"""
    (map_w, map_h), (sprite_w, sprite_h), (x_pos, y_pos) = map_dim, sprite_dim, sprite_pos
    rel_x = (x_pos + sprite_w / 2) / map_w
    rel_y = (y_pos + sprite_h / 2) / map_h
    rel_w = sprite_w / map_w
    rel_h = sprite_h / map_h

    return (rel_x, rel_y, rel_w, rel_h)