]> git.sesse.net Git - kdenlive/commitdiff
Fix clip end resizing bug
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 8 Mar 2008 22:21:45 +0000 (22:21 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 8 Mar 2008 22:21:45 +0000 (22:21 +0000)
svn path=/branches/KDE4/; revision=2024

src/clipitem.cpp

index 9f8ae13cef92801e844d98d3647fb45dd0646e19..6abd4ff32619f9d11dd94f5c1cbb7ad4370907eb 100644 (file)
@@ -81,10 +81,12 @@ ClipItem::ClipItem(DocClipBase *clip, int track, GenTime startpos, const QRectF
         connect(endThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetEndThumb()));
 
     } else if (m_clipType == COLOR) {
+       m_maxDuration = GenTime(10000, m_fps);
         QString colour = m_xml.attribute("colour");
         colour = colour.replace(0, 2, "#");
         setBrush(QColor(colour.left(7)));
     } else if (m_clipType == IMAGE) {
+       m_maxDuration = GenTime(10000, m_fps);
         m_startPix = KThumb::getImage(KUrl(m_xml.attribute("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
     } else if (m_clipType == AUDIO) {
         connect(clip, SIGNAL(gotAudioData()), this, SLOT(slotGotAudioData()));
@@ -645,8 +647,8 @@ void ClipItem::resizeEnd(int posx, double scale) {
     //kDebug() << "-- RESCALE: CROP=" << m_cropStart << ", DIFF = " << durationDiff;
     if (m_cropDuration + durationDiff <= GenTime()) {
         durationDiff = GenTime() - (m_cropDuration - GenTime(3, m_fps));
-    } else if (m_cropDuration + durationDiff >= m_maxDuration) {
-        durationDiff = m_maxDuration - m_cropDuration;
+    } else if (m_cropStart + m_cropDuration + durationDiff >= m_maxDuration) {
+        durationDiff = m_maxDuration - m_cropDuration - m_cropStart;
     }
     m_cropDuration += durationDiff;
     setRect(m_startPos.frames(m_fps) * scale, rect().y(), m_cropDuration.frames(m_fps) * scale, rect().height());