mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Added add_background_rectangle to Matrix
This commit is contained in:
parent
ec57ef47a0
commit
9dbf4e4b89
1 changed files with 5 additions and 2 deletions
|
@ -86,8 +86,7 @@ class Matrix(VMobject):
|
|||
for mob in self.elements:
|
||||
mob.add_background_rectangle()
|
||||
if self.include_background_rectangle:
|
||||
self.background_rectangle = BackgroundRectangle(self)
|
||||
self.add_to_back(self.background_rectangle)
|
||||
self.add_background_rectangle()
|
||||
|
||||
def matrix_to_mob_matrix(self, matrix):
|
||||
return np.vectorize(
|
||||
|
@ -117,6 +116,10 @@ class Matrix(VMobject):
|
|||
self.brackets = VGroup(l_bracket, r_bracket)
|
||||
return self
|
||||
|
||||
def add_background_rectangle(self):
|
||||
self.background_rectangle = BackgroundRectangle(self)
|
||||
self.add_to_back(self.background_rectangle)
|
||||
|
||||
def set_color_columns(self, *colors):
|
||||
for i, color in enumerate(colors):
|
||||
VGroup(*self.mob_matrix[:, i]).set_color(color)
|
||||
|
|
Loading…
Add table
Reference in a new issue