Skip to content

Commit

Permalink
Make sure Window matches aspect ratio of Camera
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Jul 19, 2022
1 parent 0406557 commit 69bb4f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions manimlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down

0 comments on commit 69bb4f0

Please sign in to comment.