mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Small changes to frames.py
This commit is contained in:
parent
e3ee258d91
commit
8bfa458091
1 changed files with 5 additions and 9 deletions
|
@ -5,14 +5,14 @@ from manimlib.utils.config_ops import digest_config
|
||||||
|
|
||||||
class ScreenRectangle(Rectangle):
|
class ScreenRectangle(Rectangle):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"width_to_height_ratio": 16.0 / 9.0,
|
"aspect_ratio": 16.0 / 9.0,
|
||||||
"height": 4
|
"height": 4
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
Rectangle.__init__(self, **kwargs)
|
Rectangle.__init__(self, **kwargs)
|
||||||
self.set_width(
|
self.set_width(
|
||||||
self.width_to_height_ratio * self.get_height(),
|
self.aspect_ratio * self.get_height(),
|
||||||
stretch=True
|
stretch=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,18 +34,14 @@ class FullScreenFadeRectangle(FullScreenRectangle):
|
||||||
class PictureInPictureFrame(Rectangle):
|
class PictureInPictureFrame(Rectangle):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"height": 3,
|
"height": 3,
|
||||||
"aspect_ratio": (16, 9)
|
"aspect_ratio": 16.0 / 9.0
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
digest_config(self, kwargs)
|
digest_config(self, kwargs)
|
||||||
height = self.height
|
|
||||||
if "height" in kwargs:
|
|
||||||
kwargs.pop("height")
|
|
||||||
Rectangle.__init__(
|
Rectangle.__init__(
|
||||||
self,
|
self,
|
||||||
width=self.aspect_ratio[0],
|
width=self.aspect_ratio * self.height,
|
||||||
height=self.aspect_ratio[1],
|
height=self.height,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
self.set_height(height)
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue