Only display writing message when a new tex file is actually being written

This commit is contained in:
Grant Sanderson 2021-01-30 22:12:44 -08:00
parent 53cfbacab4
commit 3c0f8abe5f

View file

@ -37,6 +37,7 @@ class SingleStringTex(VMobject):
assert(isinstance(tex_string, str))
self.tex_string = tex_string
if tex_string not in tex_string_to_mob_map:
with display_during_execution(f" Writing \"{tex_string}\""):
full_tex = self.get_tex_file_body(tex_string)
filename = tex_to_svg_file(full_tex)
svg_mob = SVGMobject(
@ -48,7 +49,6 @@ class SingleStringTex(VMobject):
}
)
tex_string_to_mob_map[tex_string] = svg_mob
self.add(*(
sm.copy()
for sm in tex_string_to_mob_map[tex_string]
@ -164,7 +164,6 @@ class Tex(SingleStringTex):
digest_config(self, kwargs)
self.tex_strings = self.break_up_tex_strings(tex_strings)
full_string = self.arg_separator.join(self.tex_strings)
with display_during_execution(f" Writing \"{full_string}\""):
super().__init__(full_string, **kwargs)
self.break_up_by_substrings()
self.set_color_by_tex_to_color_map(self.tex_to_color_map)