'Bound the selection `rect` to a sensible size.'

def _bound_selection_rect(self, rect):

    srect = self.scene.sceneRect()
    vrect = self.viewport_rect()
    maxrect = srect.united(vrect)
    return rect.intersected(maxrect)
