}
m_info.cropDuration += durationDiff;
+ m_info.endPos += durationDiff;
setRect(0, 0, cropDuration().frames(m_fps) - 0.02, rect().height());
if (durationDiff > GenTime()) {
if (item->type() == AVWIDGET) {
ItemInfo resizeinfo = info;
resizeinfo.track = m_document->tracksCount() - resizeinfo.track;
- bool success = m_document->renderer()->mltResizeClipEnd(resizeinfo, resizeinfo.endPos - resizeinfo.startPos);
+ bool success = m_document->renderer()->mltResizeClipEnd(resizeinfo, resizeinfo.cropDuration);
if (success) {
// Check if there is an automatic transition on that clip (lower track)
Transition *tr = getTransitionItemAtEnd(oldInfo.endPos, oldInfo.track);
/** @brief Updates @param item's pan and zoom effect after resize or cut.
* @param item clip whose pan and zoom effect should be updated
- * @param cutPos (optional) if clip was cut, cut position relative to the original's clip position
- *
- */
+ * @param cutPos (optional) if clip was cut, cut position relative to the original's clip position */
void updatePanZoom(ClipItem *item, GenTime cutPos = GenTime());
private slots:
int clipIndex = trackPlaylist.get_clip_index_at((int) info.startPos.frames(m_fps));
//kDebug() << "// SELECTED CLIP START: " << trackPlaylist.clip_start(clipIndex);
Mlt::Producer *clip = trackPlaylist.get_clip(clipIndex);
+
int previousStart = clip->get_in();
int newDuration = (int) clipDuration.frames(m_fps) - 1;
- int currentOut = (int)(info.cropStart + info.cropDuration).frames(m_fps) - 1;
int diff = newDuration - (trackPlaylist.clip_length(clipIndex) - 1);
+
+ int currentOut;
+ if (info.cropStart < GenTime())
+ currentOut = newDuration - info.cropStart.frames(m_fps);
+ else
+ currentOut = newDuration + previousStart;
if (currentOut > clip->get_length()) {
clip->parent().set("length", currentOut + 1);
clip->parent().set("out", currentOut);
clip->set("length", currentOut + 1);
}
+
/*if (newDuration > clip->get_out()) {
clip->parent().set_in_and_out(0, newDuration + 1);
clip->set_in_and_out(0, newDuration + 1);