From: Jean-Baptiste M. <jb...@kd...> - 2012-06-19 20:22:31
|
Git commit b3ef3d6bba3948ac47b033fc996d09fa85dd1681 by Jean-Baptiste Mardelle. Committed on 19/06/2012 at 22:21. Pushed by mardelle into branch 'v0.9'. Fix pasting fade effect in a group M +6 -6 src/clipitem.cpp M +6 -0 src/effectstack/effectstackview2.cpp http://commits.kde.org/kdenlive/b3ef3d6bba3948ac47b033fc996d09fa85dd1681 diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 3f34296..fa7afda 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -283,7 +283,7 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset) int start = end; if (effect.attribute("id") == "fadeout") { if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) { - int effectDuration = EffectsList::parameter(effect, "in").toInt(); + int effectDuration = EffectsList::parameter(effect, "out").toInt() - EffectsList::parameter(effect, "in").toInt(); if (effectDuration > cropDuration().frames(m_fps)) { effectDuration = cropDuration().frames(m_fps) / 2; } @@ -294,7 +294,7 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset) } } else if (effect.attribute("id") == "fade_to_black") { if (m_effectList.hasEffect(QString(), "fadeout") == -1) { - int effectDuration = EffectsList::parameter(effect, "in").toInt(); + int effectDuration = EffectsList::parameter(effect, "out").toInt() - EffectsList::parameter(effect, "in").toInt(); if (effectDuration > cropDuration().frames(m_fps)) { effectDuration = cropDuration().frames(m_fps) / 2; } @@ -312,23 +312,23 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset) if (effect.attribute("id") == "fadein") { if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) { int effectDuration = EffectsList::parameter(effect, "out").toInt(); - if (offset != 0) effectDuration -= offset - cropStart().frames(m_fps); + if (offset != 0) effectDuration -= offset; if (effectDuration > cropDuration().frames(m_fps)) { effectDuration = cropDuration().frames(m_fps) / 2; } end += effectDuration; } else - end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fade_from_black"), "out").toInt(); + end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fade_from_black"), "out").toInt() - offset; } else if (effect.attribute("id") == "fade_from_black") { if (m_effectList.hasEffect(QString(), "fadein") == -1) { int effectDuration = EffectsList::parameter(effect, "out").toInt(); - if (offset != 0) effectDuration -= offset - cropStart().frames(m_fps); + if (offset != 0) effectDuration -= offset; if (effectDuration > cropDuration().frames(m_fps)) { effectDuration = cropDuration().frames(m_fps) / 2; } end += effectDuration; } else - end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fadein"), "out").toInt(); + end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fadein"), "out").toInt() - offset; } EffectsList::setParameter(effect, "in", QString::number(start)); EffectsList::setParameter(effect, "out", QString::number(end)); diff --git a/src/effectstack/effectstackview2.cpp b/src/effectstack/effectstackview2.cpp index 3200951..98591ba 100644 --- a/src/effectstack/effectstackview2.cpp +++ b/src/effectstack/effectstackview2.cpp @@ -388,6 +388,12 @@ void EffectStackView2::startDrag() } else if (m_draggedGroup) { doc = m_draggedGroup->effectsData(); + if (m_effectMetaInfo.trackMode) { + doc.documentElement().setAttribute("clipstart", 0); + } + else { + doc.documentElement().setAttribute("clipstart", m_clipref->cropStart().frames(KdenliveSettings::project_fps())); + } pixmap = QPixmap::grabWidget(m_draggedGroup->title()); } else return; |