manim/tests/test_camera.py
Mohsin Shaikh 584d80242f
Allow using :meth:.MovingCamera.auto_zoom without animation (#2693)
* Allow using `MovingCamera.auto_zoom` without animation

* added test for auto_zoom width

* type hints for MovingCamera.auto_zoom

* black

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-22 23:07:52 +02:00

11 lines
297 B
Python

from __future__ import annotations
from manim import MovingCamera, Square
def test_movingcamera_auto_zoom():
camera = MovingCamera()
square = Square()
margin = 0.5
camera.auto_zoom([square], margin=margin, animate=False)
assert camera.frame.height == square.height + margin