mirror of
https://github.com/3b1b/manim.git
synced 2025-11-01 15:08:59 +00:00
Catch screeninfo.ScreenInfoError error
This commit is contained in:
parent
79c89ad34d
commit
d1314e5a3c
1 changed files with 5 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ import colour
|
||||||
import importlib
|
import importlib
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
from screeninfo import get_monitors
|
import screeninfo
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
@ -433,7 +433,10 @@ def get_file_writer_config(args: Namespace, custom_config: dict) -> dict:
|
||||||
def get_window_config(args: Namespace, custom_config: dict, camera_config: dict) -> dict:
|
def get_window_config(args: Namespace, custom_config: dict, camera_config: dict) -> dict:
|
||||||
# Default to making window half the screen size
|
# Default to making window half the screen size
|
||||||
# but make it full screen if -f is passed in
|
# but make it full screen if -f is passed in
|
||||||
monitors = get_monitors()
|
try:
|
||||||
|
monitors = screeninfo.get_monitors()
|
||||||
|
except screeninfo.ScreenInfoError:
|
||||||
|
pass
|
||||||
mon_index = custom_config["window_monitor"]
|
mon_index = custom_config["window_monitor"]
|
||||||
monitor = monitors[min(mon_index, len(monitors) - 1)]
|
monitor = monitors[min(mon_index, len(monitors) - 1)]
|
||||||
aspect_ratio = camera_config["pixel_width"] / camera_config["pixel_height"]
|
aspect_ratio = camera_config["pixel_width"] / camera_config["pixel_height"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue