]> git.sesse.net Git - kdenlive/commitdiff
Fix frame size changed in pan & zoom effect when changing clip duration
authorTill Theato <root@ttill.de>
Wed, 1 Sep 2010 15:05:51 +0000 (15:05 +0000)
committerTill Theato <root@ttill.de>
Wed, 1 Sep 2010 15:05:51 +0000 (15:05 +0000)
svn path=/trunk/kdenlive/; revision=4803

src/clipitem.cpp
src/clipitem.h
src/customtrackview.cpp

index db0f69fac76c4fe1614aa4801e8d80d5e80ffcb9..561ab7d04166f4bd1f0788adcc779a52b660de1f 100644 (file)
@@ -1210,7 +1210,7 @@ void ClipItem::resizeEnd(int posx)
 }
 
 
-bool ClipItem::checkEffectsKeyframesPos(const int previous, const int current, bool fromStart)
+bool ClipItem::checkEffectsKeyframesPos(const int previous, const int current, bool fromStart, int renderWidth, int renderHeight)
 {
     bool effModified = false;
     for (int i = 0; i < m_effectList.count(); i++) {
@@ -1253,9 +1253,7 @@ bool ClipItem::checkEffectsKeyframesPos(const int previous, const int current, b
                     e.setAttribute("keyframes", newkfr);
                 }
             } else if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
-                char *tmp = (char *) qstrdup(e.attribute("value").toUtf8().data());
-                Mlt::Geometry geometry(tmp, cropDuration().frames(fps()));
-                delete[] tmp;
+                Mlt::Geometry geometry(e.attribute("value").toUtf8().data(), cropDuration().frames(fps()), renderWidth, renderHeight);
 
                 Mlt::GeometryItem item;
                 while (!geometry.next_key(&item, cropDuration().frames(fps()))) {
index 07c6698858a46e1221ab7b70896414fe664cfffc..8e474f38740a1b3f8d2a0b1ff71a02f32896f632 100644 (file)
@@ -156,7 +156,7 @@ public:
     * @param current New crop value
     * @param fromStart true = crop from start, false = crop from end
     * @return true if anything was modified */
-    bool checkEffectsKeyframesPos(const int previous, const int current, bool fromStart);
+    bool checkEffectsKeyframesPos(const int previous, const int current, bool fromStart, int renderWidth = 0, int renderHeight = 0);
     void insertKeyframe(QDomElement effect, int pos, int val);
     void movedKeyframe(QDomElement effect, int oldpos, int newpos, double value);
     void updateKeyframes(QDomElement effect);
index 28f20905c3c9879bd9d8130179bb4c3f961012f0..3a4d07cf416bff724144e84f7fcb8f2ef6fced04 100644 (file)
@@ -4410,7 +4410,7 @@ void CustomTrackView::prepareResizeClipStart(AbstractClipItem* item, ItemInfo ol
                 indexes.append(panZoomPos);
             }
 
-            if (clip->checkEffectsKeyframesPos(oldInfo.cropStart.frames(m_document->fps()), clip->cropStart().frames(m_document->fps()), true)) {
+            if (clip->checkEffectsKeyframesPos(oldInfo.cropStart.frames(m_document->fps()), clip->cropStart().frames(m_document->fps()), true, m_document->width(), m_document->height())) {
                 // Keyframes were modified, updateClip
                 QDomNodeList effs = doc.elementsByTagName("effect");
                 // Hack: