mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 03:47:44 +00:00
Performance improvements for Write and DrawBorderWithFill
This commit is contained in:
parent
0c6149c9dd
commit
3938f81c1b
1 changed files with 5 additions and 0 deletions
|
|
@ -70,6 +70,10 @@ class DrawBorderThenFill(Animation):
|
||||||
super().__init__(vmobject, **kwargs)
|
super().__init__(vmobject, **kwargs)
|
||||||
|
|
||||||
def begin(self):
|
def begin(self):
|
||||||
|
# Trigger triangulation calculation
|
||||||
|
for submob in self.mobject.get_family():
|
||||||
|
submob.get_triangulation()
|
||||||
|
|
||||||
self.outline = self.get_outline()
|
self.outline = self.get_outline()
|
||||||
super().begin()
|
super().begin()
|
||||||
self.mobject.match_style(self.outline)
|
self.mobject.match_style(self.outline)
|
||||||
|
|
@ -103,6 +107,7 @@ class DrawBorderThenFill(Animation):
|
||||||
submob.set_data(outline.data)
|
submob.set_data(outline.data)
|
||||||
submob.unlock_data()
|
submob.unlock_data()
|
||||||
submob.lock_matching_data(submob, start)
|
submob.lock_matching_data(submob, start)
|
||||||
|
submob.needs_new_triangulation = False
|
||||||
self.sm_to_index[hash(submob)] = 1
|
self.sm_to_index[hash(submob)] = 1
|
||||||
|
|
||||||
if index == 0:
|
if index == 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue