]> git.sesse.net Git - kdenlive/commitdiff
Fix fade problem when resizing clip:http://kdenlive.org/mantis/view.php?id=2843
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 10 Dec 2012 21:50:53 +0000 (22:50 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 10 Dec 2012 21:50:53 +0000 (22:50 +0100)
src/clipitem.cpp
src/commands/editeffectcommand.cpp
src/commands/resizeclipcommand.cpp
src/customtrackview.cpp
src/effectstack/effectstackview2.cpp
src/positionedit.cpp

index fcae1feb0449f11485eb9e89a62768541f1ae7a8..0171874b176aed77a5ffa4d0b41a5391c18565e0 100644 (file)
@@ -1944,8 +1944,9 @@ QMap<int, QDomElement> ClipItem::adjustEffectsToDuration(int width, int height,
                         effects[i] = effect.cloneNode().toElement();
                     EffectsList::setParameter(effect, "out", QString::number(clipEnd));
                 }
-                if (effects.contains(i))
+                if (effects.contains(i)) {
                     setFadeIn(out - in);
+               }
             } else {
                 if (out != clipEnd) {
                     effects[i] = effect.cloneNode().toElement();
index 6ecc75b41d585233bab41b2e5d57c0fb61ca51ab..10654c182a7bbbce19bbbe68621d972e7bd4e276 100644 (file)
@@ -66,7 +66,9 @@ void EditEffectCommand::undo()
 // virtual
 void EditEffectCommand::redo()
 {
-    if (m_doIt) m_view->updateEffect(m_track, m_pos, m_effect, m_refreshEffectStack);
+    if (m_doIt) {
+       m_view->updateEffect(m_track, m_pos, m_effect, m_refreshEffectStack);
+    }
     m_doIt = true;
     m_refreshEffectStack = true;
 }
index 9cde2c4bf7a16e5c2b35f253d1280c11559e0996..dba66a9469bc43aa58477174ea4b9c12499b92d7 100644 (file)
@@ -42,7 +42,9 @@ void ResizeClipCommand::undo()
 // virtual
 void ResizeClipCommand::redo()
 {
-    if (m_doIt) m_view->resizeClip(m_startPos, m_endPos, m_dontWorry);
+    if (m_doIt) {
+       m_view->resizeClip(m_startPos, m_endPos, m_dontWorry);
+    }
     m_doIt = true;
 }
 
index 29d3999ea4325f8ff82ed2db1866f27bdc174770..db64a0543efade39c33bc858ee39d832f1ddf6f6 100644 (file)
@@ -7569,7 +7569,7 @@ void CustomTrackView::adjustEffects(ClipItem* item, ItemInfo oldInfo, QUndoComma
 {
     QMap<int, QDomElement> effects = item->adjustEffectsToDuration(m_document->width(), m_document->height(), oldInfo);
 
-    if (effects.count()) {
+    if (!effects.isEmpty()) {
         QMap<int, QDomElement>::const_iterator i = effects.constBegin();
         while (i != effects.constEnd()) {
             new EditEffectCommand(this, m_document->tracksCount() - item->track(), item->startPos(), i.value(), item->effect(i.key()), i.value().attribute("kdenlive_ix").toInt(), true, true, command);
index d67f2bbc337e987eb8e1031c384577ff639d9186..52803e9d9402144265e3fc1d89a3e5342da20324 100644 (file)
@@ -96,8 +96,7 @@ void EffectStackView2::slotRenderPos(int pos)
 void EffectStackView2::slotClipItemUpdate()
 {
     int inPoint = m_clipref->cropStart().frames(KdenliveSettings::project_fps());
-    int outPoint = m_clipref->cropDuration().frames(KdenliveSettings::project_fps()) - inPoint;
-    CollapsibleEffect *effectToMove = NULL;
+    int outPoint = m_clipref->cropDuration().frames(KdenliveSettings::project_fps()) + inPoint;
     for (int i = 0; i < m_effects.count(); i++) {
         m_effects.at(i)->setRange(inPoint, outPoint);
     }
index aaeac222449168e8ade295294639362b566c573f..ad8d4e14e92fa5efcbd4232190c40783e8675db7 100644 (file)
@@ -83,8 +83,8 @@ void PositionEdit::slotUpdatePosition()
 
 void PositionEdit::setRange(int min, int max)
 {
-    m_slider->setRange(min, max);
-    m_display->setRange(min, max);
+    m_slider->setRange(0, max - min);
+    m_display->setRange(0, max - min);
 }
 
 #include "positionedit.moc"