mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 12:07:45 +00:00
Changed implementation of ShowPassingFlash to something that felt less confusing
This commit is contained in:
parent
358b1e6313
commit
40273bab1d
1 changed files with 5 additions and 5 deletions
|
|
@ -24,7 +24,6 @@ from manimlib.utils.rate_functions import smooth
|
|||
from manimlib.utils.rate_functions import squish_rate_func
|
||||
from manimlib.utils.rate_functions import there_and_back
|
||||
from manimlib.utils.rate_functions import wiggle
|
||||
from manimlib.utils.rate_functions import double_smooth
|
||||
|
||||
|
||||
class FocusOn(Transform):
|
||||
|
|
@ -125,10 +124,11 @@ class ShowPassingFlash(ShowPartial):
|
|||
}
|
||||
|
||||
def get_bounds(self, alpha):
|
||||
alpha *= (1 + self.time_width)
|
||||
alpha -= self.time_width / 2.0
|
||||
lower = max(0, alpha - self.time_width / 2.0)
|
||||
upper = min(1, alpha + self.time_width / 2.0)
|
||||
tw = self.time_width
|
||||
upper = interpolate(0, 1 + tw, alpha)
|
||||
lower = upper - tw
|
||||
upper = min(upper, 1)
|
||||
lower = max(lower, 0)
|
||||
return (lower, upper)
|
||||
|
||||
def clean_up(self, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue