From e405af45afa5f215fd874fd63cdcd4c62cf83fd1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Wed, 26 Nov 2008 18:12:38 +0000 Subject: [PATCH] Fix crash / corruption as reported in: http://www.kdenlive.org:80/mantis/view.php?id=362 svn path=/branches/KDE4/; revision=2736 --- src/abstractclipitem.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/abstractclipitem.cpp b/src/abstractclipitem.cpp index 47fda274..103a01d6 100644 --- a/src/abstractclipitem.cpp +++ b/src/abstractclipitem.cpp @@ -87,10 +87,19 @@ void AbstractClipItem::resizeStart(int posx, double speed) { m_cropDuration = m_cropDuration - durationDiff * speed; setRect(0, 0, cropDuration().frames(m_fps) - 0.02, rect().height()); - setPos((qreal) m_startPos.frames(m_fps), pos().y()); + setPos(m_startPos.frames(m_fps), pos().y()); + + if (pos().x() != m_startPos.frames(m_fps)) { + GenTime diff = GenTime(pos().x(), m_fps) - m_startPos; + m_startPos += diff; + m_cropDuration = m_cropDuration - diff; + if (type() == AVWIDGET) m_cropStart = m_cropStart + diff; + setRect(0, 0, cropDuration().frames(m_fps) - 0.02, rect().height()); + } //kDebug() << "-- NEW CLIP=" << startPos().frames(25) << "-" << endPos().frames(25); //setRect((double) m_startPos.frames(m_fps) * scale, rect().y(), (double) m_cropDuration.frames(m_fps) * scale, rect().height()); + if (durationDiff < GenTime()) { QList collisionList = collidingItems(Qt::IntersectsItemBoundingRect); for (int i = 0; i < collisionList.size(); ++i) { -- 2.39.2