事情起源于这个动画:
self.show_lines_of_two_atom = Succession(DrawBorderThenFill(VGroup(line, vertical_line)), FadeOut(VGroup(line, vertical_line)))
我发现动画结束后 line 和 vertical_line 会重新突然添加到屏幕上,如果将 FadeOut 中的 VGroup 去掉也不行:
self.show_lines_of_two_atom = Succession(DrawBorderThenFill(VGroup(line, vertical_line)), FadeOut(line, vertical_line))
将 VGroup 定义为一个新变量就可以解决问题:
lines = VGroup(line, vertical_line) self.show_lines_of_two_atom = Succession(DrawBorderThenFill(lines), FadeOut(lines))
所以我猜想 VGroup() 将会产生一个新对象
标签:VGroup,vertical,对象,FadeOut,将会,lines,DrawBorderThenFill,line From: https://www.cnblogs.com/daxiangcai/p/17205339.html