Make sure animations will trigger a refresh for joint products

This commit is contained in:
Grant Sanderson 2023-01-31 12:49:02 -08:00
parent 92e4d43ca3
commit 60aae748a7
2 changed files with 10 additions and 5 deletions

View file

@ -98,11 +98,7 @@ class DrawBorderThenFill(Animation):
self.mobject = vmobject
def begin(self) -> None:
# Trigger triangulation calculation
for submob in self.mobject.get_family():
if not submob._use_winding_fill:
submob.get_triangulation()
self.mobject.set_animating_status(True)
self.outline = self.get_outline()
super().begin()
self.mobject.match_style(self.outline)

View file

@ -1239,6 +1239,15 @@ class VMobject(Mobject):
super().apply_points_function(*args, **kwargs)
self.refresh_joint_products()
def set_animating_status(self, is_animating: bool, recurse: bool = True):
super().set_animating_status(is_animating, recurse)
if is_animating:
for submob in self.get_family(recurse):
submob.get_joint_products(refresh=True)
if not submob._use_winding_fill:
submob.get_triangulation()
return self
# For shaders
def init_shader_data(self, ctx: Context):
dtype = self.shader_dtype