Fix MathTex on experimental (#3871)

* Fix MathTex
This commit is contained in:
Aarush Deshpande 2024-07-31 19:54:40 -04:00 committed by GitHub
commit d09b03bb45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -3,6 +3,14 @@ from manim import *
class Test(Scene):
def construct(self) -> None:
self.play(
Create(
t := Tex(
"Hello, world!", stroke_color=RED, fill_color=BLUE, stroke_width=2
)
)
)
self.play(FadeOut(t))
s = Square()
self.add(s)
self.play(Rotate(s, PI / 2))

View file

@ -292,6 +292,11 @@ class MathTex(SingleStringMathTex):
self._organize_submobjects_left_to_right()
self.note_changed_family()
# 5 hours of work went into this line
# and it's still not perfect
# July 18, 2024
self.note_changed_family()
def _break_up_tex_strings(self, tex_strings):
# Separate out anything surrounded in double braces
pre_split_length = len(tex_strings)