mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Don't use 'become' for interpolate at alpha = 0 or 1
This commit is contained in:
parent
a8da171adb
commit
8ef71bb930
2 changed files with 6 additions and 4 deletions
|
@ -121,10 +121,6 @@ class Transform(Animation):
|
|||
target_copy: Mobject,
|
||||
alpha: float
|
||||
):
|
||||
if alpha == 0:
|
||||
submob.become(start)
|
||||
elif alpha == 1:
|
||||
submob.become(target_copy)
|
||||
submob.interpolate(start, target_copy, alpha, self.path_func)
|
||||
return self
|
||||
|
||||
|
|
|
@ -1719,6 +1719,12 @@ class Mobject(object):
|
|||
keys = [k for k in self.data.dtype.names if k not in self.locked_data_keys]
|
||||
if keys:
|
||||
self.note_changed_data()
|
||||
if alpha == 0:
|
||||
self.data[:] = mobject1.data[:]
|
||||
keys = []
|
||||
elif alpha == 1:
|
||||
self.data[:] = mobject2.data[:]
|
||||
keys = []
|
||||
for key in keys:
|
||||
func = path_func if key in self.pointlike_data_keys else interpolate
|
||||
md1 = mobject1.data[key]
|
||||
|
|
Loading…
Add table
Reference in a new issue