mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
If chosen monitor is not available, choose one that does exist
This commit is contained in:
parent
b48ce3f1de
commit
120d26defa
2 changed files with 6 additions and 2 deletions
|
@ -234,7 +234,9 @@ def get_configuration(args):
|
|||
|
||||
# Default to making window half the screen size
|
||||
# but make it full screen if -f is passed in
|
||||
monitor = get_monitors()[custom_config["window_monitor"]]
|
||||
monitors = get_monitors()
|
||||
mon_index = custom_config["window_monitor"]
|
||||
monitor = monitors[min(mon_index, len(monitors) - 1)]
|
||||
window_width = monitor.width
|
||||
if not args.full_screen:
|
||||
window_width //= 2
|
||||
|
|
|
@ -38,7 +38,9 @@ class Window(PygletWindow):
|
|||
|
||||
def find_initial_position(self, size):
|
||||
custom_position = get_customization()["window_position"]
|
||||
monitor = get_monitors()[get_customization()["window_monitor"]]
|
||||
monitors = get_monitors()
|
||||
mon_index = get_customization()["window_monitor"]
|
||||
monitor = monitors[min(mon_index, len(monitors) - 1)]
|
||||
window_width, window_height = size
|
||||
# Position might be specified with a string of the form
|
||||
# x,y for integers x and y
|
||||
|
|
Loading…
Add table
Reference in a new issue