Skip to content

Commit

Permalink
Fix clip left behind after two move operations
Browse files Browse the repository at this point in the history
The undo helper only saves info for tracks that were affected.
So we can not merge two move operations if they affected different
tracks. Maybe in the future we can merge the undo helpers.

As reported here:
https://forum.shotcut.org/t/beta-version-24-02-now-available-to-test/43064/18
  • Loading branch information
bmatherly committed Feb 24, 2024
1 parent db22d2c commit eb69579
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commands/timelinecommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ bool MoveClipCommand::mergeWith(const QUndoCommand *other)
|| that->m_ripple != m_ripple || that->m_rippleAllTracks != m_rippleAllTracks
|| that->m_rippleMarkers != m_rippleMarkers)
return false;
if (that->m_undoHelper.affectedTracks() != m_undoHelper.affectedTracks()) {
return false;
}
auto thisIterator = m_clips.begin();
auto thatIterator = that->m_clips.begin();
while (thisIterator != m_clips.end() && thatIterator != that->m_clips.end()) {
Expand Down
4 changes: 4 additions & 0 deletions src/commands/undohelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class UndoHelper
void recordAfterState();
void undoChanges();
void setHints(OptimizationHints hints);
QSet<int> affectedTracks() const
{
return m_affectedTracks;
}

private:
void debugPrintState(const QString &title);
Expand Down

0 comments on commit eb69579

Please sign in to comment.