Add shorted method for setting background stroke

This commit is contained in:
Grant Sanderson 2020-06-26 15:35:37 -07:00
parent 21bf3c3e3a
commit c2feb6fff1

View file

@ -25,10 +25,8 @@ class TexSymbol(VMobjectFromSVGPathstring):
class SingleStringTexMobject(SVGMobject): class SingleStringTexMobject(SVGMobject):
CONFIG = { CONFIG = {
"template_tex_file_body": TEMPLATE_TEX_FILE_BODY, "template_tex_file_body": TEMPLATE_TEX_FILE_BODY,
"stroke_width": 0,
"fill_opacity": 1.0, "fill_opacity": 1.0,
"background_stroke_width": 1, "stroke_width": 0,
"background_stroke_color": BLACK,
"should_center": True, "should_center": True,
"height": None, "height": None,
"organize_left_to_right": False, "organize_left_to_right": False,
@ -233,6 +231,10 @@ class TexMobject(SingleStringTexMobject):
self.set_color_by_tex(tex, color, **kwargs) self.set_color_by_tex(tex, color, **kwargs)
return self return self
def set_bstroke(self, color=BLACK, width=4):
self.set_stroke(color, width, background=True)
return self
def index_of_part(self, part): def index_of_part(self, part):
split_self = self.split() split_self = self.split()
if part not in split_self: if part not in split_self: