From b26feb70458cd212b911ea152b08391ca7c032b1 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 21 Mar 2024 09:59:29 -0300 Subject: [PATCH] Adjust Underline configuration --- manimlib/mobject/shape_matchers.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/manimlib/mobject/shape_matchers.py b/manimlib/mobject/shape_matchers.py index d42bde90..c201ad14 100644 --- a/manimlib/mobject/shape_matchers.py +++ b/manimlib/mobject/shape_matchers.py @@ -118,17 +118,13 @@ class Underline(Line): mobject: Mobject, buff: float = SMALL_BUFF, 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, **kwargs ): - super().__init__( - LEFT, RIGHT, - stroke_color=stroke_color, - stroke_width=stroke_width, - **kwargs - ) - self.insert_n_curves(30) + super().__init__(LEFT, RIGHT, **kwargs) + if not isinstance(stroke_width, (float, int)): + self.insert_n_curves(len(stroke_width) - 2) self.set_stroke(stroke_color, stroke_width) self.set_width(mobject.get_width() * stretch_factor) self.next_to(mobject, DOWN, buff=buff)