Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

edit: Close Gap refuses a locked track

Oskar86d113e55717
diff --git a/crates/edit/src/lib.rs b/crates/edit/src/lib.rs
index 2f5a8382b..3bd1b370e 100644
--- a/crates/edit/src/lib.rs
+++ b/crates/edit/src/lib.rs
@@ -448,6 +448,10 @@ pub fn ripple_delete_items(seq: &mut Sequence, items: &[ClipId]) -> Result<Vec<T
/// Close the gap containing `t` on a track (Ripple Delete on a gap).
pub fn close_gap(seq: &mut Sequence, track: TrackId, t: Tick) -> Result<()> {
let tr = seq.track(track).ok_or(EditError::NoTrack(track))?;
+ if tr.locked {
+ // the other tracks would move while this one stayed put
+ return Err(EditError::Locked);
+ }
if tr.item_at(t).is_some() {
return Err(EditError::Nothing);
}