Fix T90836: Strip snaps to empty space

This was caused by snap to hold offset feature, which calculates strip
content boundary, but it can be outside of strip boundary.

Clamp content start and end values so they are always inside of strip.
This commit is contained in:
Richard Antalik 2021-10-25 04:24:41 +02:00
parent 3e75f70acd
commit 28ad680ff0
Notes: blender-bot 2023-02-14 00:29:15 +01:00
Referenced by issue #90836, VSE: Multiple invisible snap lines (with "Hold offset" snap option turned on)
1 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,10 @@ static void seq_snap_target_points_build(const TransInfo *t,
content_end = seq->enddisp;
}
}
CLAMP(content_start, seq->startdisp, seq->enddisp);
CLAMP(content_end, seq->startdisp, seq->enddisp);
snap_data->target_snap_points[i] = content_start;
snap_data->target_snap_points[i + 1] = content_end;
i += 2;