Adjust Underline configuration

This commit is contained in:
Grant Sanderson 2024-03-21 09:59:29 -03:00
parent 7db69e32aa
commit b26feb7045

View file

@ -118,17 +118,13 @@ class Underline(Line):
mobject: Mobject, mobject: Mobject,
buff: float = SMALL_BUFF, buff: float = SMALL_BUFF,
stroke_color=WHITE, stroke_color=WHITE,
stroke_width: float | Sequence[float] = [0, 3, 3, 0], stroke_width: float | Sequence[float] = [0, 2, 3, 3, 2, 0],
stretch_factor=1.2, stretch_factor=1.2,
**kwargs **kwargs
): ):
super().__init__( super().__init__(LEFT, RIGHT, **kwargs)
LEFT, RIGHT, if not isinstance(stroke_width, (float, int)):
stroke_color=stroke_color, self.insert_n_curves(len(stroke_width) - 2)
stroke_width=stroke_width,
**kwargs
)
self.insert_n_curves(30)
self.set_stroke(stroke_color, stroke_width) self.set_stroke(stroke_color, stroke_width)
self.set_width(mobject.get_width() * stretch_factor) self.set_width(mobject.get_width() * stretch_factor)
self.next_to(mobject, DOWN, buff=buff) self.next_to(mobject, DOWN, buff=buff)