Revert "Move display_during_exection associated with Latex rendering"

This reverts commit ab470c3ee5.
This commit is contained in:
Grant Sanderson 2022-12-19 16:54:55 -08:00
parent a53867d8a1
commit c2c8149627
3 changed files with 11 additions and 8 deletions

View file

@ -3,6 +3,7 @@ from __future__ import annotations
import re
from manimlib.mobject.svg.string_mobject import StringMobject
from manimlib.utils.tex_file_writing import display_during_execution
from manimlib.utils.tex_file_writing import tex_content_to_svg_file
from typing import TYPE_CHECKING
@ -78,9 +79,10 @@ class MTex(StringMobject):
)
def get_file_path_by_content(self, content: str) -> str:
file_path = tex_content_to_svg_file(
content, self.template, self.additional_preamble
)
with display_during_execution(f"Writing \"{self.tex_string}\""):
file_path = tex_content_to_svg_file(
content, self.template, self.additional_preamble
)
return file_path
# Parsing

View file

@ -11,6 +11,7 @@ from manimlib.constants import MED_LARGE_BUFF, SMALL_BUFF
from manimlib.mobject.geometry import Line
from manimlib.mobject.svg.svg_mobject import SVGMobject
from manimlib.mobject.types.vectorized_mobject import VGroup
from manimlib.utils.tex_file_writing import display_during_execution
from manimlib.utils.tex_file_writing import tex_content_to_svg_file
from typing import TYPE_CHECKING
@ -85,9 +86,10 @@ class SingleStringTex(SVGMobject):
def get_file_path(self) -> str:
content = self.get_tex_file_body(self.tex_string)
file_path = tex_content_to_svg_file(
content, self.template, self.additional_preamble
)
with display_during_execution(f"Writing \"{self.tex_string}\""):
file_path = tex_content_to_svg_file(
content, self.template, self.additional_preamble
)
return file_path
def get_tex_file_body(self, tex_string: str) -> str:

View file

@ -78,8 +78,7 @@ def tex_content_to_svg_file(
)
if not os.path.exists(svg_file):
# If svg doesn't exist, create it
with display_during_execution(f"Writing \"{content}\""):
create_tex_svg(full_tex, svg_file, compiler)
create_tex_svg(full_tex, svg_file, compiler)
return svg_file