mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 19:46:21 +08:00
fix aspect_ratio other than 16:9 issue
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user