From 72be365c6ba699e84d628b910f1e00eae1e69a85 Mon Sep 17 00:00:00 2001 From: John Kiril Swenson Date: Mon, 14 Oct 2024 00:49:01 +0200 Subject: [PATCH] Fix #126191: Both handle seqslide modal cancel The issue was that if the seqslide was cancelled such that the `new_frame` of the left handle was greater than its previous right_handle (before the cancel), `SEQ_time_left_handle_frame_set()` would clamp this value and so the left handle would not properly restore itself. Fix by updating both handles at once (right handle first) if both handles are selected and the cancel jump travels in the right direction. This also seems to fix the situation where strips w/ both handles selected would be erroneously detected as overlapping when moving them rapidly side to side. Pull Request: https://projects.blender.org/blender/blender/pulls/128740 --- .../editors/transform/transform_convert_sequencer.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/editors/transform/transform_convert_sequencer.cc b/source/blender/editors/transform/transform_convert_sequencer.cc index 9cfa833219a..b3126f6547d 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.cc +++ b/source/blender/editors/transform/transform_convert_sequencer.cc @@ -602,6 +602,15 @@ static void flushTransSeq(TransInfo *t) break; } case SEQ_LEFTSEL: { /* No vertical transform. */ + /* Update right handle first if both handles are selected and the new_frame is right of + * the old one to avoid unexpected left handle clamping when cancelling. See #126191. */ + bool both_handles_selected = (tdsq->flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) == + (SEQ_LEFTSEL | SEQ_RIGHTSEL); + if (both_handles_selected && new_frame > SEQ_time_left_handle_frame_get(scene, seq)) { + a++, td++, td2d++; + int new_right_frame = round_fl_to_int(td->loc[0] + edge_pan_offset[0]); + SEQ_time_right_handle_frame_set(scene, seq, new_right_frame); + } int old_startdisp = SEQ_time_left_handle_frame_get(scene, seq); SEQ_time_left_handle_frame_set(t->scene, seq, new_frame);