diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-08-31 04:12:00 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-08-31 04:12:00 +0300 |
commit | b08ab49cceaba9ad541ae5d50720bae6b5c96c40 (patch) | |
tree | d4833b10bcf78e81e3e4a6f72fe4a0fd24771586 /source | |
parent | bd67bf4d106e260a9b246931187862d54f9fb69c (diff) |
Fix T90988: Incorrect speed effect strip math
Math implemented in 929d7597b345 was incorrect, but also inconsistent
with previous behavior.
`SEQ_SPEED_STRETCH` should change length only when right handle is
moved. This is now documented in code.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/sequencer/intern/effects.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/sequencer/intern/effects.c b/source/blender/sequencer/intern/effects.c index 37bac523645..80314d34360 100644 --- a/source/blender/sequencer/intern/effects.c +++ b/source/blender/sequencer/intern/effects.c @@ -3186,10 +3186,12 @@ float seq_speed_effect_target_frame_get(Scene *scene, float target_frame = 0.0f; switch (s->speed_control_type) { case SEQ_SPEED_STRETCH: { - const float target_content_length = seq_effect_speed_get_strip_content_length(source); - const float target_strip_length = source->enddisp - source->startdisp; - const float ratio = target_content_length / target_strip_length; - target_frame = frame_index * ratio; + /* Only right handle controls effect speed! */ + const float target_content_length = seq_effect_speed_get_strip_content_length(source) - + source->startofs; + const float speed_effetct_length = seq_speed->enddisp - seq_speed->startdisp; + const float ratio = frame_index / speed_effetct_length; + target_frame = target_content_length * ratio; break; } case SEQ_SPEED_MULTIPLY: { |