Skip to content

Video editing with Python

Undo premature corrections

Tom Burrowse470b71ae181
diff --git a/moviepy/video/compositing/transitions.py b/moviepy/video/compositing/transitions.py
index 27c472b1..98c0155a 100644
--- a/moviepy/video/compositing/transitions.py
+++ b/moviepy/video/compositing/transitions.py
@@ -105,10 +105,10 @@ def slide_out(clip, duration, side):
w, h = clip.size
ts = clip.duration - duration # start time of the effect.
- pos_dict = {'left': lambda t: (min(0, w*(-(t-ts)/duration)), 'center'),
- 'right': lambda t: (max(0, w*((t-ts)/duration)), 'center'),
- 'top': lambda t: ('center', min(0, h*(-(t-ts)/duration))),
- 'bottom': lambda t: ('center', max(0, h*((t-ts)/duration)))}
+ pos_dict = {'left': lambda t: (min(0, w*(1-(t-ts)/duration)), 'center'),
+ 'right': lambda t: (max(0, w*((t-ts)/duration-1)), 'center'),
+ 'top': lambda t: ('center', min(0, h*(1-(t-ts)/duration))),
+ 'bottom': lambda t: ('center', max(0, h*((t-ts)/duration-1)))}
return clip.set_pos(pos_dict[side])