Repository: ManimCommunity/manim
File: manim/camera/moving_camera.py (Python)

Code before:
        should think of all other mobjects on the screen as moving

        Returns
        -------
        list
        """
        return [self.frame]

    def auto_zoom(self, mobjects, margin=0, only_mobjects_in_frame=False):
        """Zooms on to a given array of mobjects (or a singular mobject) and automatically resizes to frame all the mobjects

        Parameters
        ----------
        mobjects
            The mobject or array of mobjects that the camera should focus on

        margin
            The amount of padding that should be added to the view (optional)

        only_mobjects_in_frame
            If set to True, only allows focusing on mobjects that are already in frame

        Returns
        -------
        _AnimationBuilder
            Returns an animation that focuses on a given array of mobjects (or a singular mobject)

        """
        scene_critical_x_left = None
        scene_critical_x_right = None
        scene_critical_y_up = None
        scene_critical_y_down = None

        for m in mobjects:
            if (m == self.frame) | (
                only_mobjects_in_frame & operator.not_(self.is_in_frame(m))
            ):
                # detected camera frame, should not be used to calculate final position of camera
                continue

            # initialize scene critical points with first mobjects critical points
            if scene_critical_x_left == None:
                scene_critical_x_left = m.get_critical_point(LEFT)[0]
                scene_critical_x_right = m.get_critical_point(RIGHT)[0]
                scene_critical_y_up = m.get_critical_point(UP)[1]
                scene_critical_y_down = m.get_critical_point(DOWN)[1]

            else:
                if m.get_critical_point(LEFT)[0] < scene_critical_x_left:
                    scene_critical_x_left = m.get_critical_point(LEFT)[0]


Review comment (suggestion):
```suggestion
            Returns an animation that zooms the camera view to a given
            list of mobjects.
```

Code after:
        return [self.frame]

    def auto_zoom(self, mobjects, margin=0, only_mobjects_in_frame=False):
        """Zooms on to a given array of mobjects (or a singular mobject)
        and automatically resizes to frame all the mobjects.

        .. NOTE::

            This method only works when 2D-objects in the XY-plane are considered, it
            will not work correctly when the camera has been rotated.

        Parameters
        ----------
        mobjects
            The mobject or array of mobjects that the camera will focus on.

        margin
            The width of the margin that is added to the frame (optional, 0 by default).

        only_mobjects_in_frame
            If set to ``True``, only allows focusing on mobjects that are already in frame.

        Returns
        -------
        _AnimationBuilder
            Returns an animation that zooms the camera view to a given
            list of mobjects.

        """
        scene_critical_x_left = None
        scene_critical_x_right = None
        scene_critical_y_up = None
        scene_critical_y_down = None

        for m in mobjects:
            if (m == self.frame) or (
                only_mobjects_in_frame and not self.is_in_frame(m)
            ):
                # detected camera frame, should not be used to calculate final position of camera
                continue

            # initialize scene critical points with first mobjects critical points
            if scene_critical_x_left == None:
                scene_critical_x_left = m.get_critical_point(LEFT)[0]
                scene_critical_x_right = m.get_critical_point(RIGHT)[0]
                scene_critical_y_up = m.get_critical_point(UP)[1]
                scene_critical_y_down = m.get_critical_point(DOWN)[1]

            else:
                if m.get_critical_point(LEFT)[0] < scene_critical_x_left:
                    scene_critical_x_left = m.get_critical_point(LEFT)[0]