if (type() == AVWIDGET) m_cropStart += durationDiff * speed;
m_cropDuration = m_cropDuration - durationDiff * speed;
+ setRect(0, 0, cropDuration().frames(m_fps) - 0.02, rect().height());
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());
}
- 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());
// calculate new position.
if (group()) return pos();
QPointF newPos = value.toPointF();
- kDebug() << "/// MOVING CLIP ITEM.------------\n++++++++++";
+ // kDebug() << "/// MOVING CLIP ITEM.------------\n++++++++++";
int xpos = projectScene()->getSnapPointForPos((int) newPos.x(), KdenliveSettings::snaptopoints());
xpos = qMax(xpos, 0);
newPos.setX(xpos);
if (items.at(i)->type() == type()) {
// Collision!
QPointF otherPos = items.at(i)->pos();
- if ((int) otherPos.y() != (int) pos().y()) return pos();
+ if ((int) otherPos.y() != (int) pos().y()) {
+ return pos();
+ }
if (pos().x() < otherPos.x()) {
// move clip just before colliding clip
int npos = (static_cast < AbstractClipItem* >(items.at(i))->startPos() - m_cropDuration).frames(m_fps);
QList<QGraphicsItem *> itemList = items();
ClipItem *item;
Transition *transitionitem;
+ bool snap = KdenliveSettings::snaptopoints();
+ KdenliveSettings::setSnaptopoints(false);
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
item = (ClipItem*) itemList.at(i);
setSceneRect(0, 0, sceneRect().width(), m_tracksHeight * m_document->tracksCount());
// verticalScrollBar()->setMaximum(m_tracksHeight * m_document->tracksCount());
+ KdenliveSettings::setSnaptopoints(snap);
update();
}
QDomElement transition = MainWindow::transitions.getEffectByName("Luma").cloneNode().toElement();
EffectsList::setParameter(transition, "reverse", "1");
slotAddTransition((ClipItem *) m_dragItem, info, transitiontrack, transition);
+ } else if ((m_operationMode == RESIZESTART || m_operationMode == RESIZEEND) && m_selectionGroup) {
+ resetSelectionGroup(false);
+ m_dragItem->setSelected(true);
}
m_blockRefresh = false;
}
if (m_selectionGroup) {
+ bool snap = KdenliveSettings::snaptopoints();
+ KdenliveSettings::setSnaptopoints(false);
QPointF top = m_selectionGroup->boundingRect().topLeft();
m_selectionGroup->setPos(top);
m_selectionGroup->translate(-top.x(), -top.y() + 1);
m_selectionGroupInfo.startPos = GenTime(m_selectionGroup->scenePos().x(), m_document->fps());
m_selectionGroupInfo.track = m_selectionGroup->track();
+ KdenliveSettings::setSnaptopoints(snap);
}
} else resetSelectionGroup();
}
}
bool success = m_document->renderer()->mltMoveClip((int)(m_document->tracksCount() - start.track), (int)(m_document->tracksCount() - end.track), (int) start.startPos.frames(m_document->fps()), (int)end.startPos.frames(m_document->fps()), item->baseClip()->producer(end.track));
if (success) {
+ bool snap = KdenliveSettings::snaptopoints();
+ KdenliveSettings::setSnaptopoints(false);
item->setPos((int) end.startPos.frames(m_document->fps()), (int)(end.track * m_tracksHeight + 1));
m_scene->clearSelection();
item->setSelected(true);
tr->setPos((int) end.startPos.frames(m_document->fps()), (int)(end.track * m_tracksHeight + 1));
}
}
+ KdenliveSettings::setSnaptopoints(snap);
} else {
// undo last move and emit error message
emit displayMessage(i18n("Cannot move clip to position %1", m_document->timecode().getTimecodeFromFrames(end.startPos.frames(m_document->fps()))), ErrorMessage);
QPointF pos = m_selectionGroup->pos();
qreal posx = pos.x() + offset.frames(m_document->fps());
qreal posy = pos.y() + trackOffset * (qreal) m_tracksHeight;
+ bool snap = KdenliveSettings::snaptopoints();
+ KdenliveSettings::setSnaptopoints(false);
+
m_selectionGroup->setPos(posx, posy);
QPointF top = m_selectionGroup->sceneBoundingRect().topLeft();
m_document->renderer()->mltAddTransition(tr->transitionTag(), newTrack, m_document->tracksCount() - info.track, info.startPos, info.endPos, tr->toXML());
}
}
+ KdenliveSettings::setSnaptopoints(snap);
}
}
return;
}
//kDebug() << "---------------- Move TRANSITION FROM: " << startPos.x() << ", END:" << endPos.x() << ",TRACKS: " << oldtrack << " TO " << newtrack;
-
+ bool snap = KdenliveSettings::snaptopoints();
+ KdenliveSettings::setSnaptopoints(false);
//kDebug()<<"/// RESIZE TRANS START: ("<< startPos.x()<<"x"<< startPos.y()<<") / ("<<endPos.x()<<"x"<< endPos.y()<<")";
if (end.endPos - end.startPos == start.endPos - start.startPos) {
// Transition was moved
item->resizeEnd((int) end.endPos.frames(m_document->fps()));
}
//item->moveTransition(GenTime((int) (endPos.x() - startPos.x()), m_document->fps()));
+ KdenliveSettings::setSnaptopoints(snap);
item->updateTransitionEndTrack(getPreviousVideoTrack(end.track));
m_document->renderer()->mltMoveTransition(item->transitionTag(), m_document->tracksCount() - start.track, m_document->tracksCount() - end.track, item->transitionEndTrack(), start.startPos, start.endPos, end.startPos, end.endPos);
}