+ GenTime durationDiff = GenTime(posx, m_fps) - endPos();
+ if (durationDiff == GenTime()) return;
+ //kDebug() << "-- RESCALE: CROP=" << m_cropStart << ", DIFF = " << durationDiff;
+ if (m_cropDuration + durationDiff <= GenTime()) {
+ durationDiff = GenTime() - (m_cropDuration - GenTime(3, m_fps));
+ } 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());
+ QList <QGraphicsItem *> collisionList = collidingItems(Qt::IntersectsItemBoundingRect);
+ for (int i = 0; i < collisionList.size(); ++i) {
+ QGraphicsItem *item = collisionList.at(i);
+ if (item->type() == type()) {
+ GenTime diff = ((AbstractClipItem *)item)->startPos() - GenTime(1, m_fps) - startPos();
+ m_cropDuration = diff;
+ setRect(m_startPos.frames(m_fps) * scale, rect().y(), m_cropDuration.frames(m_fps) * scale, rect().height());
+ break;
+ }
+ }