Fix crash on resize after recent group resize fix

parent 62b260d7
Pipeline #3556 passed with stage
in 18 minutes and 56 seconds
......@@ -1581,17 +1581,17 @@ void TimelineModel::processGroupResize(QVariantList startPos, QVariantList endPo
bool result = true;
while (i.hasNext()) {
i.next();
QPair<int,int> startPos = i.value();
QPair<int,int> endPos = endData.value(i.key());
if (startPos.first != endPos.first || startPos.second != endPos.second) {
QPair<int,int> startItemPos = i.value();
QPair<int,int> endItemPos = endData.value(i.key());
if (startItemPos.first != endItemPos.first || startItemPos.second != endItemPos.second) {
// Revert individual items to original position
requestItemResize(i.key(), startPos.second, right, false, 0, true);
requestItemResize(i.key(), startItemPos.second, right, false, 0, true);
changedItems << i.key();
}
}
for (int id : changedItems) {
QPair<int,int> endPos = endData.value(id);
result = result & requestItemResize(id, endPos.second, right, true, undo, redo, false);
QPair<int,int> endItemPos = endData.value(id);
result = result & requestItemResize(id, endItemPos.second, right, true, undo, redo, false);
if (!result) {
break;
}
......
......@@ -279,7 +279,7 @@ Column{
}
onTrimmedIn: {
bubbleHelp.hide()
if (shiftTrim) {
if (shiftTrim || clip.groupTrimData == undefined) {
// We only resize one element
controller.requestItemResize(clip.clipId, clip.originalDuration, false, false, root.snapping, shiftTrim)
controller.requestItemResize(clip.clipId, clip.lastValidDuration, false, true, root.snapping, shiftTrim)
......@@ -287,7 +287,6 @@ Column{
var updatedGroupData = controller.getGroupData(clip.clipId)
controller.processGroupResize(clip.groupTrimData, updatedGroupData, false)
}
clip.groupTrimData = undefined
}
onTrimmingOut: {
......@@ -305,13 +304,14 @@ Column{
}
onTrimmedOut: {
bubbleHelp.hide()
if (shiftTrim) {
if (shiftTrim || clip.groupTrimData == undefined) {
controller.requestItemResize(clip.clipId, clip.originalDuration, true, false, root.snapping, shiftTrim)
controller.requestItemResize(clip.clipId, clip.lastValidDuration, true, true, root.snapping, shiftTrim)
} else {
var updatedGroupData = controller.getGroupData(clip.clipId)
controller.processGroupResize(clip.groupTrimData, updatedGroupData, true)
}
clip.groupTrimData = undefined
}
}
}
......
Markdown is supported
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