mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 14:27:46 +00:00
Make sure Window matches aspect ratio of Camera
This commit is contained in:
parent
0406557b5c
commit
69bb4f026c
1 changed files with 4 additions and 3 deletions
|
|
@ -393,10 +393,11 @@ def get_configuration(args):
|
|||
monitors = get_monitors()
|
||||
mon_index = custom_config["window_monitor"]
|
||||
monitor = monitors[min(mon_index, len(monitors) - 1)]
|
||||
window_width = monitor.width
|
||||
aspect_ratio = config["camera_config"]["pixel_width"] / config["camera_config"]["pixel_height"]
|
||||
window_height = monitor.height
|
||||
if not (args.full_screen or custom_config["full_screen"]):
|
||||
window_width //= 2
|
||||
window_height = window_width * 9 // 16
|
||||
window_height //= 2
|
||||
window_width = int(window_height * aspect_ratio)
|
||||
config["window_config"] = {
|
||||
"size": (window_width, window_height),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue