Commit 4f522688 authored by Julius Künzel's avatar Julius Künzel
Browse files

Further fixes for guide moving on spacer operations

Related to 9a08ea41
parent 1bb40db3
Pipeline #61496 passed with stage
in 8 minutes and 12 seconds
......@@ -447,7 +447,7 @@ QList<CommentedTime> MarkerListModel::getMarkersInRange(int start, int end) cons
QList<CommentedTime> markers;
for (const auto &marker : m_markerList) {
int pos = marker.second.time().frames(pCore->getCurrentFps());
if(pos > start && (end == -1 || pos < end)) {
if(pos >= start && (end == -1 || pos <= end)) {
markers << marker.second;
}
}
......
......@@ -390,7 +390,7 @@ int TimelineFunctions::requestSpacerStartOperation(const std::shared_ptr<Timelin
return -1;
}
bool TimelineFunctions::requestSpacerEndOperation(const std::shared_ptr<TimelineItemModel> &timeline, int itemId, int startPosition, int endPosition, int affectedTrack, Fun &undo, Fun &redo)
bool TimelineFunctions::requestSpacerEndOperation(const std::shared_ptr<TimelineItemModel> &timeline, int itemId, int startPosition, int endPosition, int affectedTrack, bool moveGuides, Fun &undo, Fun &redo)
{
// Move group back to original position
int track = timeline->getItemTrackId(itemId);
......@@ -403,7 +403,7 @@ bool TimelineFunctions::requestSpacerEndOperation(const std::shared_ptr<Timeline
timeline->requestSubtitleMove(itemId, startPosition, false, false);
}
// Move guides
if (!KdenliveSettings::lockedGuides()) {
if (moveGuides) {
GenTime fromPos(startPosition, pCore->getCurrentFps());
GenTime toPos(endPosition, pCore->getCurrentFps());
QList<CommentedTime> guides = pCore->currentDoc()->getGuideModel()->getMarkersInRange(startPosition, -1);
......@@ -1912,7 +1912,7 @@ bool TimelineFunctions::requestDeleteBlankAt(const std::shared_ptr<TimelineItemM
// Start undoable command
std::function<bool(void)> undo = []() { return true; };
std::function<bool(void)> redo = []() { return true; };
requestSpacerEndOperation(timeline, cid, start, start - spaceDuration, affectAllTracks ? -1 : trackId, undo, redo);
requestSpacerEndOperation(timeline, cid, start, start - spaceDuration, affectAllTracks ? -1 : trackId, !KdenliveSettings::lockedGuides(), undo, redo);
return true;
}
......
......@@ -86,7 +86,7 @@ struct TimelineFunctions
static bool requestDeleteBlankAt(const std::shared_ptr<TimelineItemModel> &timeline, int trackId, int position, bool affectAllTracks);
static int requestSpacerStartOperation(const std::shared_ptr<TimelineItemModel> &timeline, int trackId, int position);
static bool requestSpacerEndOperation(const std::shared_ptr<TimelineItemModel> &timeline, int itemId, int startPosition, int endPosition, int affectedTrack, Fun &undo, Fun &redo);
static bool requestSpacerEndOperation(const std::shared_ptr<TimelineItemModel> &timeline, int itemId, int startPosition, int endPosition, int affectedTrack, bool moveGuides, Fun &undo, Fun &redo);
static bool extractZone(const std::shared_ptr<TimelineItemModel> &timeline, QVector<int> tracks, QPoint zone, bool liftOnly);
static bool liftZone(const std::shared_ptr<TimelineItemModel> &timeline, int trackId, QPoint zone, Fun &undo, Fun &redo);
static bool removeSpace(const std::shared_ptr<TimelineItemModel> &timeline, QPoint zone, Fun &undo, Fun &redo, QVector<int> allowedTracks = QVector<int>(), bool useTargets = true);
......
......@@ -1642,10 +1642,10 @@ bool TimelineController::requestSpacerEndOperation(int clipId, int startPosition
// Start undoable command
std::function<bool(void)> undo = []() { return true; };
std::function<bool(void)> redo = []() { return true; };
if(guideStart > -1 && KdenliveSettings::lockedGuides()) {
if(guideStart > -1) {
moveGuidesInRange(guideStart, -1, endPosition - startPosition, undo, redo);
}
bool result = TimelineFunctions::requestSpacerEndOperation(m_model, clipId, startPosition, endPosition, affectedTrack, undo, redo);
bool result = TimelineFunctions::requestSpacerEndOperation(m_model, clipId, startPosition, endPosition, affectedTrack, false, undo, redo);
return result;
}
......
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