mirror of
https://github.com/3b1b/manim.git
synced 2025-08-31 16:48:31 +00:00
Add options for bracket spacing in Matrix
This commit is contained in:
parent
22f8e24d41
commit
ee04922400
1 changed files with 7 additions and 3 deletions
|
@ -56,6 +56,8 @@ class Matrix(VMobject):
|
|||
CONFIG = {
|
||||
"v_buff": 0.8,
|
||||
"h_buff": 1.3,
|
||||
"bracket_h_buff": MED_SMALL_BUFF,
|
||||
"bracket_v_buff": MED_SMALL_BUFF,
|
||||
"add_background_rectangles_to_entries": False,
|
||||
"include_background_rectangle": False,
|
||||
"element_to_mobject": TexMobject,
|
||||
|
@ -101,10 +103,12 @@ class Matrix(VMobject):
|
|||
def add_brackets(self):
|
||||
bracket_pair = TexMobject("\\big[", "\\big]")
|
||||
bracket_pair.scale(2)
|
||||
bracket_pair.stretch_to_fit_height(self.get_height() + 0.5)
|
||||
bracket_pair.stretch_to_fit_height(
|
||||
self.get_height() + 2 * self.bracket_v_buff
|
||||
)
|
||||
l_bracket, r_bracket = bracket_pair.split()
|
||||
l_bracket.next_to(self, LEFT)
|
||||
r_bracket.next_to(self, RIGHT)
|
||||
l_bracket.next_to(self, LEFT, self.bracket_h_buff)
|
||||
r_bracket.next_to(self, RIGHT, self.bracket_h_buff)
|
||||
self.add(l_bracket, r_bracket)
|
||||
self.brackets = VGroup(l_bracket, r_bracket)
|
||||
return self
|
||||
|
|
Loading…
Add table
Reference in a new issue