]> git.sesse.net Git - kdenlive/commitdiff
Fix timeline breaking with razor tool
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 30 Sep 2009 12:58:33 +0000 (12:58 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 30 Sep 2009 12:58:33 +0000 (12:58 +0000)
svn path=/trunk/kdenlive/; revision=3964

src/customtrackview.cpp
src/definitions.h

index c65d3b91001bf2c4738c96c7d5757bb4ed8e6e2c..4d23ec715ffa44773456692dbbfff33d958312aa 100644 (file)
@@ -1688,9 +1688,12 @@ void CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut)
         double speed = item->speed();
         newPos.startPos = cutTime;
         newPos.endPos = info.endPos;
-        if (speed == 1) newPos.cropStart = item->info().cropStart + (cutTime - info.startPos);
-        else newPos.cropStart = item->info().cropStart + (cutTime - info.startPos) * speed;
+        newPos.cropStart = item->info().cropStart + (cutTime - info.startPos);
         newPos.track = info.track;
+        newPos.cropDuration = GenTime((int)((newPos.endPos - newPos.startPos).frames(m_document->fps()) * speed), m_document->fps());
+        newPos.originalcropStart = GenTime((int)(newPos.cropStart .frames(m_document->fps()) * speed), m_document->fps());
+
+        
         ClipItem *dup = item->clone(newPos);
         // remove unwanted effects (fade in) from 2nd part of cutted clip
         int ix = dup->hasEffect(QString(), "fadein");
index c8725fc0b00de5367ee976593e5990adda87c55a..57f67c7077c30cd2f46e3e79c73d01dae16338f7 100644 (file)
@@ -66,11 +66,11 @@ struct ItemInfo {
     GenTime startPos;
     /** endPos is the duration where the clip ends on the track */
     GenTime endPos;
-    /** cropStart is the position where the sub-clip starts, relative to the clip's 0 position. Doe not depend on speed */
+    /** originalcropStart is the position where the sub-clip starts, relative to the clip's 0 position. Doe not depend on speed */
     GenTime originalcropStart;
-    /** adjustedCropStart is the position where the sub-clip starts, depend on effects (speed,...) */
+    /** cropStart is the position where the sub-clip starts, depend on effects (speed,...) */
     GenTime cropStart;
-    /** cropDuration is the position where the sub-clip ends, relative to the clip's 0 position. Doe not depend on speed */
+    /** cropDuration is the duration of the clip, does not depend on speed */
     GenTime cropDuration;
     int track;
 };