MCPcopy
hub / github.com/ManimCommunity/manim / test_zoom

Function test_zoom

tests/module/scene/test_auto_zoom.py:6–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def test_zoom():
7 s1 = Square()
8 s1.set_x(-10)
9 s2 = Square()
10 s2.set_x(10)
11
12 with tempconfig({"dry_run": True, "quality": "low_quality"}):
13 scene = MovingCameraScene()
14 scene.add(s1, s2)
15 scene.play(scene.camera.auto_zoom([s1, s2]))
16
17 assert scene.camera.frame_width == abs(
18 s1.get_left()[0] - s2.get_right()[0],
19 )
20 assert scene.camera.frame.get_center()[0] == (
21 abs(s1.get_center()[0] + s2.get_center()[0]) / 2
22 )

Callers

nothing calls this directly

Calls 10

SquareClass · 0.85
tempconfigFunction · 0.85
MovingCameraSceneClass · 0.85
auto_zoomMethod · 0.80
set_xMethod · 0.45
addMethod · 0.45
playMethod · 0.45
get_leftMethod · 0.45
get_rightMethod · 0.45
get_centerMethod · 0.45

Tested by

no test coverage detected