Commit 4dcd6d55 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle Committed by Ed Rogalsky
Browse files

Fix some problems with transitions keyframes

parent 19c1cbda
......@@ -5225,18 +5225,18 @@ void CustomTrackView::prepareResizeClipEnd(AbstractClipItem* item, ItemInfo oldI
QDomElement xml = transition->toXML();
m_document->renderer()->mltUpdateTransition(xml.attribute("tag"), xml.attribute("tag"), xml.attribute("transition_btrack").toInt(), m_document->tracksCount() - xml.attribute("transition_atrack").toInt(), transition->startPos(), transition->endPos(), xml);
new EditTransitionCommand(this, transition->track(), transition->startPos(), old, xml, false, command);
ItemInfo info = transition->info();
QPoint p;
ClipItem *transitionClip = getClipItemAt(info.startPos, info.track);
if (transitionClip && transitionClip->baseClip()) {
QString size = transitionClip->baseClip()->getProperty("frame_size");
double factor = transitionClip->baseClip()->getProperty("aspect_ratio").toDouble();
if (factor == 0) factor = 1.0;
p.setX((int)(size.section('x', 0, 0).toInt() * factor + 0.5));
p.setY(size.section('x', 1, 1).toInt());
}
emit transitionItemSelected(transition, getPreviousVideoTrack(info.track), p, true);
}
ItemInfo info = transition->info();
QPoint p;
ClipItem *transitionClip = getClipItemAt(info.startPos, info.track);
if (transitionClip && transitionClip->baseClip()) {
QString size = transitionClip->baseClip()->getProperty("frame_size");
double factor = transitionClip->baseClip()->getProperty("aspect_ratio").toDouble();
if (factor == 0) factor = 1.0;
p.setX((int)(size.section('x', 0, 0).toInt() * factor + 0.5));
p.setY(size.section('x', 1, 1).toInt());
}
emit transitionItemSelected(transition, getPreviousVideoTrack(info.track), p, true);
new MoveTransitionCommand(this, oldInfo, info, false, command);
}
}
......
......@@ -82,16 +82,16 @@ void KeyframeHelper::mousePressEvent(QMouseEvent * event)
while (!m_extraMovingItems.isEmpty()) {
Mlt::GeometryItem *gitem = m_extraMovingItems.takeFirst();
delete gitem;
if (gitem) delete gitem;
}
for (int i = 0; i < m_extraGeometries.count(); i++) {
Mlt::GeometryItem *item2 = new Mlt::GeometryItem();
if (m_extraGeometries.at(i)->next_key(item, mousePos) == 0) {
Mlt::GeometryItem *item2 = new Mlt::GeometryItem();
item2->x(item.x());
item2->frame(item.frame());
m_extraMovingItems.append(item2);
} else {
delete(item2);
m_extraMovingItems.append(NULL);
}
}
......@@ -170,7 +170,7 @@ void KeyframeHelper::mouseMoveEvent(QMouseEvent * event)
if (KdenliveSettings::snaptopoints() && qAbs(pos - m_position) < 5) pos = m_position;
m_movingItem.frame(pos);
for (int i = 0; i < m_extraMovingItems.count(); i++) {
m_extraMovingItems[i]->frame(pos);
if (m_extraMovingItems.at(i)) m_extraMovingItems[i]->frame(pos);
}
update();
return;
......@@ -211,7 +211,7 @@ void KeyframeHelper::mouseReleaseEvent(QMouseEvent * event)
m_movingKeyframe = false;
for (int i = 0; i < m_extraGeometries.count(); i++) {
m_extraGeometries[i]->insert(m_extraMovingItems.at(i));
if (m_extraMovingItems.at(i)) m_extraGeometries[i]->insert(m_extraMovingItems.at(i));
}
emit keyframeMoved(m_position);
......
......@@ -165,7 +165,7 @@ void TransitionSettings::slotTransitionItemSelected(Transition* t, int nextTrack
m_effectEdit->setFrameSize(p);
m_autoTrackTransition = nextTrack;
disconnect(m_effectEdit->monitor(), SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
if (t == m_usedTransition) {
if (t == m_usedTransition) {
if (t == NULL) return;
if (update) {
transitionTrack->blockSignals(true);
......@@ -246,7 +246,7 @@ void TransitionSettings::slotCheckMonitorPosition(int renderPos)
{
if (!isEnabled()) return;
if (m_effectEdit->needsMonitorEffectScene()) {
if (renderPos >= m_usedTransition->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_usedTransition->endPos().frames(KdenliveSettings::project_fps())) {
if (renderPos >= m_usedTransition->startPos().frames(KdenliveSettings::project_fps()) && renderPos < m_usedTransition->endPos().frames(KdenliveSettings::project_fps())) {
if (!m_effectEdit->monitor()->effectSceneDisplayed()) {
m_effectEdit->monitor()->slotShowEffectScene(true);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment