mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Add LineBrace
This commit is contained in:
parent
9cc9ac7598
commit
eed34a521d
1 changed files with 10 additions and 1 deletions
|
@ -6,7 +6,7 @@ import copy
|
|||
import numpy as np
|
||||
|
||||
from manimlib.constants import DEFAULT_MOBJECT_TO_MOBJECT_BUFF, SMALL_BUFF
|
||||
from manimlib.constants import DOWN, LEFT, ORIGIN, RIGHT, DL, DR, UL
|
||||
from manimlib.constants import DOWN, LEFT, ORIGIN, RIGHT, DL, DR, UL, UP
|
||||
from manimlib.constants import PI
|
||||
from manimlib.animation.composition import AnimationGroup
|
||||
from manimlib.animation.fading import FadeIn
|
||||
|
@ -174,3 +174,12 @@ class BraceLabel(VMobject):
|
|||
|
||||
class BraceText(BraceLabel):
|
||||
label_constructor: type = TexText
|
||||
|
||||
|
||||
class LineBrace(Brace):
|
||||
def __init__(self, line: Line, direction=UP, **kwargs):
|
||||
angle = line.get_angle()
|
||||
line.rotate(-angle)
|
||||
super().__init__(line, direction, **kwargs)
|
||||
line.rotate(angle)
|
||||
self.rotate(angle, about_point=line.get_center())
|
||||
|
|
Loading…
Add table
Reference in a new issue