Fix clip disappearing on resize

parent 020e9119
......@@ -2634,7 +2634,7 @@ void CustomTrackView::cutClip(const ItemInfo &info, const GenTime &cutTime, bool
clearSelection();
}
delete item;
m_timeline->reloadTrack(info);
m_timeline->reloadTrack(info, false);
// remove unwanted effects
// fade in from 2nd part of the clip
......@@ -8525,9 +8525,9 @@ Timecode CustomTrackView::timecode()
return m_document->timecode();
}
void CustomTrackView::reloadTrack(ItemInfo info)
void CustomTrackView::reloadTrack(ItemInfo info, bool includeLastFrame)
{
m_timeline->reloadTrack(info);
m_timeline->reloadTrack(info, includeLastFrame);
}
void CustomTrackView::sortGuides()
......
......@@ -314,7 +314,7 @@ public:
* @param group The group to cut
* @param cutPos The absolute position of the cut */
void razorGroup(AbstractGroupItem *group, GenTime cutPos);
void reloadTrack(ItemInfo info);
void reloadTrack(ItemInfo info, bool includeLastFrame);
GenTime groupSelectedItems(QList <QGraphicsItem *> selection = QList <QGraphicsItem *>(), bool createNewGroup = false, bool selectNewGroup = false);
void sortGuides();
void initTools();
......
......@@ -142,7 +142,7 @@ void ResizeManager::mouseRelease(GenTime pos)
} else m_view->monitorRefresh(QList <ItemInfo>() << m_dragItemInfo << dragItem->info(), true);
m_view->clearSelection();
delete dragItem;
m_view->reloadTrack(range);
m_view->reloadTrack(range, true);
dragItem = m_view->getClipItemAtEnd(m_dragItemInfo.endPos, m_dragItemInfo.track);
if (!dragItem) {
qDebug()<<" * * ** SOMETHING WRONG HERE: "<<m_dragItemInfo.endPos.frames(m_view->fps());
......
......@@ -971,7 +971,7 @@ void Timeline::reloadTrack(int ix, int start, int end)
loadTrack(ix, 0, pl, startIndex, endIndex, false);
}
void Timeline::reloadTrack(ItemInfo info)
void Timeline::reloadTrack(ItemInfo info, bool includeLastFrame)
{
// Get playlist
if (!info.isValid())
......@@ -979,7 +979,7 @@ void Timeline::reloadTrack(ItemInfo info)
Mlt::Playlist pl = m_tracks.at(info.track)->playlist();
// Remove current clips
int startIndex = pl.get_clip_index_at(info.startPos.frames(m_doc->fps()));
int endIndex = pl.get_clip_index_at(info.endPos.frames(m_doc->fps())) - 1;
int endIndex = pl.get_clip_index_at(info.endPos.frames(m_doc->fps())) - (includeLastFrame ? 0 : 1);
// Reload items
loadTrack(info.track, 0, pl, startIndex, endIndex, false);
}
......
......@@ -166,7 +166,7 @@ public:
/** @brief Returns the document properties with some added values from timeline. */
QMap <QString, QString> documentProperties();
void reloadTrack(int ix, int start = 0, int end = -1);
void reloadTrack(ItemInfo info);
void reloadTrack(ItemInfo info, bool includeLastFrame);
/** @brief Add or remove current timeline zone to preview render zone. */
void addPreviewRange(bool add);
/** @brief Check if timeline preview profile changed and remove preview files if necessary. */
......
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