Commit 5544a82a authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix dragging a composition sometimes moved it to the beginning of the clip

parent c50680f9
Pipeline #121482 passed with stage
in 7 minutes and 5 seconds
......@@ -587,7 +587,7 @@ Rectangle {
// We want a same track composition
timeline.insertNewMix(track, sameCutPos, clipBeingDroppedData)
} else if (!isAudioDrag) {
timeline.insertNewComposition(track, frame, clipBeingDroppedData, true)
timeline.insertNewCompositionAtPos(track, frame, clipBeingDroppedData)
} else {
// Cannot insert an audio mix composition
}
......
......@@ -430,14 +430,9 @@ void TimelineController::insertNewMix(int tid, int position, const QString &tran
}
}
int TimelineController::insertNewComposition(int tid, int position, const QString &transitionId, bool logUndo)
int TimelineController::insertNewCompositionAtPos(int tid, int position, const QString &transitionId)
{
int clipId = m_model->getTrackById_const(tid)->getClipByPosition(position);
if (clipId > 0) {
int minimum = m_model->getClipPosition(clipId);
return insertNewComposition(tid, clipId, position - minimum, transitionId, logUndo);
}
return insertComposition(tid, position, transitionId, logUndo);
return insertComposition(tid, position, transitionId, true);
}
int TimelineController::insertNewComposition(int tid, int clipId, int offset, const QString &transitionId, bool logUndo)
......
......@@ -241,7 +241,7 @@ public:
@param logUndo if set to false, no undo object is stored
@return the id of the inserted composition
*/
Q_INVOKABLE int insertNewComposition(int tid, int position, const QString &transitionId, bool logUndo);
Q_INVOKABLE int insertNewCompositionAtPos(int tid, int position, const QString &transitionId);
Q_INVOKABLE int insertNewComposition(int tid, int clipId, int offset, const QString &transitionId, bool logUndo);
/** @brief Request deletion of the currently selected clips
......
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