mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 19:46:21 +08:00
Don't have Matrix try to convert lists of Mobject into numpy arrays
https://github.com/3b1b/manim/issues/1878
This commit is contained in:
@ -94,15 +94,12 @@ class Matrix(VMobject):
|
||||
or mobjects
|
||||
"""
|
||||
VMobject.__init__(self, **kwargs)
|
||||
matrix = self.matrix = np.array(matrix, ndmin=2)
|
||||
mob_matrix = self.matrix_to_mob_matrix(matrix)
|
||||
mob_matrix = self.mob_matrix = self.matrix_to_mob_matrix(matrix)
|
||||
self.organize_mob_matrix(mob_matrix)
|
||||
# self.elements = VGroup(*mob_matrix.flatten())
|
||||
self.elements = VGroup(*it.chain(*mob_matrix))
|
||||
self.add(self.elements)
|
||||
self.add_brackets()
|
||||
self.center()
|
||||
self.mob_matrix = mob_matrix
|
||||
if self.add_background_rectangles_to_entries:
|
||||
for mob in self.elements:
|
||||
mob.add_background_rectangle()
|
||||
@ -129,7 +126,7 @@ class Matrix(VMobject):
|
||||
return self
|
||||
|
||||
def add_brackets(self):
|
||||
height = self.matrix.shape[0]
|
||||
height = len(self.mob_matrix)
|
||||
bracket_pair = Tex("".join([
|
||||
"\\left[",
|
||||
"\\begin{array}{c}",
|
||||
|
Reference in New Issue
Block a user