mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Except IndexError for MTex.get_part_by_tex
This commit is contained in:
parent
2a0709664d
commit
c51811d2f1
1 changed files with 4 additions and 1 deletions
|
@ -557,7 +557,10 @@ class MTex(_TexSVG):
|
|||
|
||||
def get_part_by_tex(self, tex, index=0):
|
||||
all_parts = self.get_parts_by_tex(tex)
|
||||
return all_parts[index]
|
||||
try:
|
||||
return all_parts[index]
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
def set_color_by_tex(self, tex, color):
|
||||
self.get_parts_by_tex(tex).set_color(color)
|
||||
|
|
Loading…
Add table
Reference in a new issue