From 42220340dad36eb6eb43dd20bf42fcc8dc8023a7 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Wed, 30 Sep 2009 12:58:33 +0000 Subject: [PATCH] Fix timeline breaking with razor tool svn path=/trunk/kdenlive/; revision=3964 --- src/customtrackview.cpp | 7 +++++-- src/definitions.h | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index c65d3b91..4d23ec71 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -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"); diff --git a/src/definitions.h b/src/definitions.h index c8725fc0..57f67c70 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -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; }; -- 2.39.2