'Reset the zoom to the optimal factor.'

def reset_zoom(self):

    self.zoom = self.__initial_zoom
    self.__zoomout_limit_reached = False
    if self.__needs_to_recalculate_initial:
        self.recalculate_and_fit()
    else:
        self.setTransform(QTransform().scale(self.zoom, self.zoom))
