Commit 5de71c28 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix remove space.

Related to #1564
parent 22f41af5
Pipeline #265710 failed with stage
in 12 minutes and 15 seconds
......@@ -338,7 +338,6 @@ std::pair<int, int> TimelineFunctions::requestSpacerStartOperation(const std::sh
std::transform(clips.begin(), clips.end(), std::inserter(roots, roots.begin()), [&](int id) { return timeline->m_groups->getRootId(id); });
std::unordered_set<int> groupsToRemove;
int firstCid = -1;
int firstPosition = -1;
int spaceDuration = -1;
std::unordered_set<int> toSelect;
// List all clips involved in the spacer operation
......@@ -411,9 +410,11 @@ std::pair<int, int> TimelineFunctions::requestSpacerStartOperation(const std::sh
} else {
// Find first clip on track
int pos = timeline->getItemPosition(r);
if (firstPosition == -1 || pos < firstPosition) {
firstCid = r;
firstPosition = pos;
int tid = timeline->getItemTrackId(r);
if (!firstClipOnTrack.contains(tid)) {
firstClipOnTrack.insert(tid, r);
} else if (timeline->getItemPosition(firstClipOnTrack.value(tid)) > pos) {
firstClipOnTrack.insert(tid, r);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment