Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added example for :class:`~.UnderLine` (#1646)

Nikhil Garudad0857601a044
diff --git a/manim/mobject/shape_matchers.py b/manim/mobject/shape_matchers.py
index 4c716d312..89f2e2fc1 100644
--- a/manim/mobject/shape_matchers.py
+++ b/manim/mobject/shape_matchers.py
@@ -107,6 +107,25 @@ class Cross(VGroup):
class Underline(Line):
+ """Creates an underline.
+
+ Parameters
+ ----------
+ Line
+ The underline.
+
+ Examples
+ --------
+ .. manim:: UnderLine
+ :save_last_frame:
+
+ class UnderLine(Scene):
+ def construct(self):
+ man = Tex("Manim") # Full Word
+ ul = Underline(man) # Underlining the word
+ self.add(man, ul)
+ """
+
def __init__(self, mobject, buff=SMALL_BUFF, **kwargs):
super().__init__(LEFT, RIGHT, buff=buff, **kwargs)
self.match_width(mobject)