Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

fixed pi creature color bug

Ben Hambrechtc24f7b6926f0
diff --git a/for_3b1b_videos/pi_creature.py b/for_3b1b_videos/pi_creature.py
index b80a0e2a8..95f829737 100644
--- a/for_3b1b_videos/pi_creature.py
+++ b/for_3b1b_videos/pi_creature.py
@@ -98,14 +98,15 @@ class PiCreature(SVGMobject):
def set_color(self, color):
self.body.set_fill(color)
+ self.color = color
return self
def change_mode(self, mode):
new_self = self.__class__(
- mode=mode,
- color=self.color
+ mode = mode,
)
- new_self.scale_to_fit_height(self.get_height())
+ new_self.match_style(self)
+ new_self.match_height(self)
if self.is_flipped() ^ new_self.is_flipped():
new_self.flip()
new_self.shift(self.eyes.get_center() - new_self.eyes.get_center())