'update offset of children and return the extents of the box'

def get_extent_offsets(self, renderer):

    dpicor = renderer.points_to_pixels(1.0)
    pad = (self.pad * dpicor)
    sep = (self.sep * dpicor)
    whd_list = [c.get_extent(renderer) for c in self.get_visible_children()]
    if (not whd_list):
        return ((2 * pad), (2 * pad), pad, pad, [])
    if (self.height is None):
        height_descent = max(((h - yd) for (w, h, xd, yd) in whd_list))
        ydescent = max((yd for (w, h, xd, yd) in whd_list))
        height = (height_descent + ydescent)
    else:
        height = (self.height - (2 * pad))
    hd_list = [(h, yd) for (w, h, xd, yd) in whd_list]
    (height, ydescent, yoffsets) = _get_aligned_offsets(hd_list, self.height, self.align)
    pack_list = [(w, xd) for (w, h, xd, yd) in whd_list]
    (width, xoffsets_) = _get_packed_offsets(pack_list, self.width, sep, self.mode)
    xoffsets = (xoffsets_ + [xd for (w, h, xd, yd) in whd_list])
    xdescent = whd_list[0][2]
    xoffsets = (xoffsets - xdescent)
    return ((width + (2 * pad)), (height + (2 * pad)), (xdescent + pad), (ydescent + pad), list(zip(xoffsets, yoffsets)))
