mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Simplify VMobject.set_rgba_array
This commit is contained in:
parent
4629e08769
commit
3d0fe27c55
1 changed files with 4 additions and 12 deletions
|
@ -166,20 +166,12 @@ class VMobject(Mobject):
|
||||||
def set_rgba_array(
|
def set_rgba_array(
|
||||||
self,
|
self,
|
||||||
rgba_array: Vect4Array,
|
rgba_array: Vect4Array,
|
||||||
name: str | None = None,
|
name: str = "stroke_rgba",
|
||||||
recurse: bool = False
|
recurse: bool = False
|
||||||
) -> Self:
|
) -> Self:
|
||||||
if name is None:
|
super().set_rgba_array(rgba_array, name, recurse)
|
||||||
names = ["fill_rgba", "stroke_rgba"]
|
self.note_changed_fill()
|
||||||
else:
|
self.note_changed_stroke()
|
||||||
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()
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def set_fill(
|
def set_fill(
|
||||||
|
|
Loading…
Add table
Reference in a new issue