Skip to content

Conversation

MuRongxin
Copy link

Overview

In ZoomedScene, "zoomed_camera_image_mobject_config" cannot be configuredcausing :TypeError.

Motivation and Explanation:

In scenarios where picture-in-picture is used to zoom in on a part, it is not possible to modify the border color and thickness of the zoomed image through the configuration of "zoomed_camera_image_mobject_config".

The main reason for the problem lies in: passing improper parameters when using ImageMobjectFromCamera in zoomed_scene.py; the "ImageMobjectFromCamera" class does not handle add_display_frame appropriately.

Test Example

class TestZoomScene(ZoomedScene):
    def __init__(self,renderer=None, **kwargs):
        ZoomedScene.__init__(
            self,
            zoom_factor=0.5,
            renderer=renderer,
            zoomed_display_height=1,
            zoomed_display_width=2,
            image_frame_stroke_width=1,
            zoomed_camera_config={
                "default_frame_stroke_width": 2,
                "default_frame_stroke_color":_color_7
            },
            #=========The part that had issues before===========
            zoomed_camera_image_mobject_config={                
                "stroke_color": _color_7,
            },
            **kwargs
    )

    def construct(self):
        self.activate_zooming()
        
        self.play(self.get_zoomed_display_pop_out_animation())

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

1 participant