]> git.sesse.net Git - kdenlive/commitdiff
Fix pan & zoom effect (paste, edit after reloading project)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 12 Jun 2012 22:08:28 +0000 (00:08 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 12 Jun 2012 22:09:17 +0000 (00:09 +0200)
src/clipitem.cpp
src/customtrackview.cpp
src/trackview.cpp

index b663a6ed08eecf7220025facc679d4d8a5d235c0..14bf09f545d7185f762bd2fc34a5f83eb2c15c08 100644 (file)
@@ -269,6 +269,13 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset)
                e.setAttribute("keyframes", adjusted);
            }
         }
+
+        if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
+            // Effects with a geometry parameter need to sync in / out with parent clip
+           effect.setAttribute("in", QString::number(cropStart().frames(m_fps)));
+           effect.setAttribute("out", QString::number((cropStart() + cropDuration()).frames(m_fps) - 1));
+           effect.setAttribute("_sync_in_out", "1");
+       }
     }
     if (effect.attribute("tag") == "volume" || effect.attribute("tag") == "brightness") {
         if (effect.attribute("id") == "fadeout" || effect.attribute("id") == "fade_to_black") {
index 4c0214c9b55289d2b32bbc470bf1d33f7bbd9d84..2cb91a93cbe5ad67bc1796a201b89364ebc48f11 100644 (file)
@@ -1850,6 +1850,7 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
                    if (!clip->isSelected()) {
                        clearSelection(false);
                        clip->setSelected(true);
+                       m_dragItem = clip;
                        emit clipItemSelected(clip);
                    }
                    break;
index ea8802b0cf7f783b88c8e6d551278c61588321b4..7a5f0c99e8b79f12d53d1b0ee0ca48cfd3c7c8f4 100644 (file)
@@ -887,10 +887,11 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
             } else {
                 // Check if effect has in/out points
                 if (effect.hasAttribute("in")) {
-                    EffectsList::setParameter(currenteffect, "in",  effect.attribute("in"));
+                   currenteffect.setAttribute("in", effect.attribute("in"));
+                   currenteffect.setAttribute("_sync_in_out", "1");
                 }
                 if (effect.hasAttribute("out")) {
-                    EffectsList::setParameter(currenteffect, "out",  effect.attribute("out"));
+                   currenteffect.setAttribute("out", effect.attribute("out"));
                 }
             }