From f6cca2cc728becb29307367d23cc122d5ef02b5b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 22 Jun 2010 21:13:54 +0000 Subject: [PATCH] Fix in / out points for effects with some images (negative in points). at some point, should be fixed correctly (no more negative in points) svn path=/trunk/kdenlive/; revision=4541 --- src/clipitem.cpp | 12 +++++++++--- src/customtrackview.cpp | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 5f1c6686..f3a3baba 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -316,7 +316,7 @@ bool ClipItem::checkKeyFrames() bool effModified = false; // go through all params which have keyframes - foreach (const QString &kfr, keyframeParams) { + foreach(const QString &kfr, keyframeParams) { const QStringList keyframes = kfr.split(';', QString::SkipEmptyParts); QStringList newKeyFrames; bool cutKeyFrame = false; @@ -1416,8 +1416,14 @@ EffectsParameterList ClipItem::addEffect(const QDomElement effect, bool /*animat // special case: the affine effect need in / out points if (effectId == "pan_zoom") { - parameters.addParam("in", QString::number(cropStart().frames(m_fps))); - parameters.addParam("out", QString::number((cropStart() + cropDuration()).frames(m_fps))); + int start = cropStart().frames(m_fps); + int end = (cropStart() + cropDuration()).frames(m_fps); + if (start < 0) { + end -= start; + start = 0; + } + parameters.addParam("in", QString::number(start)); + parameters.addParam("out", QString::number(end)); } QDomNodeList params = effect.elementsByTagName("parameter"); diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index ac927aa3..d16ea7fd 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -4294,6 +4294,10 @@ void CustomTrackView::updatePositionEffects(ClipItem * item, ItemInfo info) QDomElement oldeffect = item->effectAt(effectPos); int start = item->cropStart().frames(m_document->fps()); int max = start + item->cropDuration().frames(m_document->fps()); + if (start < 0) { + max -= start; + start = 0; + } oldeffect.setAttribute("in", start); oldeffect.setAttribute("out", max); if (!m_document->renderer()->mltEditEffect(m_document->tracksCount() - item->track(), item->startPos(), item->getEffectArgs(oldeffect))) -- 2.39.2