'update offset of childrens 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)
    if (self.width is not None):
        for c in self.get_visible_children():
            if (isinstance(c, PackerBase) and (c.mode == u'expand')):
                c.set_width(self.width)
    whd_list = [c.get_extent(renderer) for c in self.get_visible_children()]
    whd_list = [(w, h, xd, (h - yd)) for (w, h, xd, yd) in whd_list]
    wd_list = [(w, xd) for (w, h, xd, yd) in whd_list]
    (width, xdescent, xoffsets) = _get_aligned_offsets(wd_list, self.width, self.align)
    pack_list = [(h, yd) for (w, h, xd, yd) in whd_list]
    (height, yoffsets_) = _get_packed_offsets(pack_list, self.height, sep, self.mode)
    yoffsets = (yoffsets_ + [yd for (w, h, xd, yd) in whd_list])
    ydescent = (height - yoffsets[0])
    yoffsets = (height - yoffsets)
    yoffsets = (yoffsets - ydescent)
    return ((width + (2 * pad)), (height + (2 * pad)), (xdescent + pad), (ydescent + pad), list(zip(xoffsets, yoffsets)))
