Skip to content

Commit

Permalink
Simplify VMobject.set_rgba_array
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Feb 3, 2023
1 parent 4629e08 commit 3d0fe27
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions manimlib/mobject/types/vectorized_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,12 @@ def init_colors(self):
def set_rgba_array(
self,
rgba_array: Vect4Array,
name: str | None = None,
name: str = "stroke_rgba",
recurse: bool = False
) -> Self:
if name is None:
names = ["fill_rgba", "stroke_rgba"]
else:
names = [name]

for name in names:
super().set_rgba_array(rgba_array, name, recurse)
if name == "fill_rgba":
self.note_changed_fill()
elif name == "stroke_rgba":
self.note_changed_stroke()
super().set_rgba_array(rgba_array, name, recurse)
self.note_changed_fill()
self.note_changed_stroke()
return self

def set_fill(
Expand Down

0 comments on commit 3d0fe27

Please sign in to comment.