From b469dc04f9f763cf5c3840f2b885da7ca0490a8b Mon Sep 17 00:00:00 2001 From: John Swenson Date: Mon, 10 Jun 2024 10:15:15 +0200 Subject: [PATCH 1/2] Fix: VSE snap to hold offset is broken Snapping to hold offsets was broken by 76043bc, this patch restores the functionality by simply calculating the image data start/end points and letting existing clamping code take over to make sure this snap target does not exist outside of the bounds of the strip. Pull Request: https://projects.blender.org/blender/blender/pulls/122934 --- .../blender/editors/transform/transform_snap_sequencer.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/transform/transform_snap_sequencer.cc b/source/blender/editors/transform/transform_snap_sequencer.cc index 9741f2a741e..11243aae7b5 100644 --- a/source/blender/editors/transform/transform_snap_sequencer.cc +++ b/source/blender/editors/transform/transform_snap_sequencer.cc @@ -207,10 +207,9 @@ static bool seq_snap_target_points_build(Scene *scene, i += 2; if (snap_mode & SEQ_SNAP_TO_STRIP_HOLD) { - int content_start = min_ii(SEQ_time_left_handle_frame_get(scene, seq), - SEQ_time_start_frame_get(seq)); - int content_end = max_ii(SEQ_time_right_handle_frame_get(scene, seq), - SEQ_time_content_end_frame_get(scene, seq)); + int content_start = SEQ_time_start_frame_get(seq); + int content_end = SEQ_time_content_end_frame_get(scene, seq); + /* Effects and single image strips produce incorrect content length. Skip these strips. */ if ((seq->type & SEQ_TYPE_EFFECT) != 0 || seq->len == 1) { content_start = SEQ_time_left_handle_frame_get(scene, seq); From 44641ac5c7acd6743838c1a358d53785efbb1f88 Mon Sep 17 00:00:00 2001 From: John Swenson Date: Sat, 8 Jun 2024 16:49:08 -0500 Subject: [PATCH 2/2] Fix: VSE snapping when both strip handles selected This patch makes sure that when both left/right handles on a strip are selected, they are given individal snap points in TransSeqSnapData. Prior to this change, when both handles were selected, snapping only worked on the left handle. Pull Request: https://projects.blender.org/blender/blender/pulls/122931 --- source/blender/editors/transform/transform_snap_sequencer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/transform/transform_snap_sequencer.cc b/source/blender/editors/transform/transform_snap_sequencer.cc index 11243aae7b5..54175964ba2 100644 --- a/source/blender/editors/transform/transform_snap_sequencer.cc +++ b/source/blender/editors/transform/transform_snap_sequencer.cc @@ -65,10 +65,10 @@ static bool seq_snap_source_points_build(const Scene *scene, int i = 0; for (Sequence *seq : snap_sources) { int left = 0, right = 0; - if (seq->flag & SEQ_LEFTSEL) { + if (seq->flag & SEQ_LEFTSEL && !(seq->flag & SEQ_RIGHTSEL)) { left = right = SEQ_time_left_handle_frame_get(scene, seq); } - else if (seq->flag & SEQ_RIGHTSEL) { + else if (seq->flag & SEQ_RIGHTSEL && !(seq->flag & SEQ_LEFTSEL)) { left = right = SEQ_time_right_handle_frame_get(scene, seq); } else {