(self)
Recalculate the optimal zoom and fits the content into view.

        Should be called if the scene contents change, so that the optimal zoom
        can be recalculated.

        Returns
        -------
Recalculate the optimal zoom and fits the content into view.
Recalculate the optimal zoom and fits the content into view .
def recalculate_and_fit(self):
        """Recalculate the optimal zoom and fits the content into view.

        Should be called if the scene contents change, so that the optimal zoom
        can be recalculated.

        Returns
        -------

        """
        if self.__central_widget is not None:
            self.fitInView(self.central_widget_rect(), Qt.KeepAspectRatio)
        else:
            self.fitInView(self.scene().sceneRect(), Qt.KeepAspectRatio)
        self.__initial_zoom = self.transform().m11()
        self.zoom = self.__initial_zoom
def recalculate_and_fit ( self ) : if self . __central_widget is not None : self . fitInView ( self . central_widget_rect ( ) , Qt . KeepAspectRatio ) else : self . fitInView ( self . scene ( ) . sceneRect ( ) , Qt . KeepAspectRatio ) self . __initial_zoom = self . transform ( ) . m11 ( ) self . zoom = self . __initial_zoom