'Update the shapes of selection items after a scale change.'

def _update_selection_items(self):

    transform = self._transform
    for (item, selection) in self._selection.items():
        path = transform.map(selection.unscaled_path)
        ppath = QPainterPath()
        margin = 4
        if item.node.is_leaf:
            ppath.addRect(path.boundingRect().adjusted((- margin), (- margin), margin, margin))
        else:
            ppath.addPolygon(path)
            ppath = path_outline(ppath, width=(margin * 2))
        selection.setPath(ppath)
