fix aspect_ratio other than 16:9 issue

This commit is contained in:
german2020
2023-08-27 13:51:54 +08:00
parent d8428585f8
commit 65e7943ff7
3 changed files with 25 additions and 6 deletions

View File

@ -9,6 +9,7 @@ import numpy as np
from manimlib.config import parse_cli
from manimlib.config import get_configuration
from manimlib.constants import ASPECT_RATIO
from manimlib.utils.directories import get_shader_dir
from manimlib.utils.file_ops import find_file
@ -112,6 +113,8 @@ def get_shader_code_from_file(filename: str) -> str | None:
with open(filepath, "r") as f:
result = f.read()
result = re.sub(r"\s+ASPECT_RATIO\s+=\s+[\s0-9/.]+", f" ASPECT_RATIO = {ASPECT_RATIO}", result)
# To share functionality between shaders, some functions are read in
# from other files an inserted into the relevant strings before