Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Small changes to frames.py

Grant Sanderson8bfa458091fd
diff --git a/manimlib/mobject/frame.py b/manimlib/mobject/frame.py
index 9b4019f68..4ea2260db 100644
--- a/manimlib/mobject/frame.py
+++ b/manimlib/mobject/frame.py
@@ -5,14 +5,14 @@ from manimlib.utils.config_ops import digest_config
class ScreenRectangle(Rectangle):
CONFIG = {
- "width_to_height_ratio": 16.0 / 9.0,
+ "aspect_ratio": 16.0 / 9.0,
"height": 4
}
def __init__(self, **kwargs):
Rectangle.__init__(self, **kwargs)
self.set_width(
- self.width_to_height_ratio * self.get_height(),
+ self.aspect_ratio * self.get_height(),
stretch=True
)
@@ -34,18 +34,14 @@ class FullScreenFadeRectangle(FullScreenRectangle):
class PictureInPictureFrame(Rectangle):
CONFIG = {
"height": 3,
- "aspect_ratio": (16, 9)
+ "aspect_ratio": 16.0 / 9.0
}
def __init__(self, **kwargs):
digest_config(self, kwargs)
- height = self.height
- if "height" in kwargs:
- kwargs.pop("height")
Rectangle.__init__(
self,
- width=self.aspect_ratio[0],
- height=self.aspect_ratio[1],
+ width=self.aspect_ratio * self.height,
+ height=self.height,
**kwargs
)
- self.set_height(height)