Commit bd08944c authored by Till Theato's avatar Till Theato

Fix effects + transitions with geometry parameter behaving strange after...

Fix effects + transitions with geometry parameter behaving strange after resize because a keyframe became invisible but was not deleted

svn path=/trunk/kdenlive/; revision=4785
parent 19d8293d
......@@ -196,8 +196,10 @@ void ClipItem::setEffectList(const EffectsList effectList)
}
}
}
if (fade > 0) m_startFade = fade;
else if (fade < 0) m_endFade = -fade;
if (fade > 0)
m_startFade = fade;
else if (fade < 0)
m_endFade = -fade;
}
setSelectedEffect(0);
}
......
......@@ -262,13 +262,13 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
GeometryWidget *geometry = new GeometryWidget(m_monitor, m_timecode, pos, isEffect, this);
// connect this before setupParam to make sure the monitor scene shows up at startup
connect(geometry, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
if (minFrame == maxFrame)
geometry->setupParam(pa, m_in, m_out);
else
geometry->setupParam(pa, minFrame, maxFrame);
m_vbox->addWidget(geometry);
m_valueItems[paramName+"geometry"] = geometry;
connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
connect(geometry, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
connect(this, SIGNAL(syncEffectsPos(int)), geometry, SLOT(slotSyncPosition(int)));
} else {
......
......@@ -190,6 +190,14 @@ void GeometryWidget::setupParam(const QDomElement elem, int minframe, int maxfra
m_geometry = new Mlt::Geometry(tmp, maxframe - minframe, m_monitor->render->renderWidth(), m_monitor->render->renderHeight());
delete[] tmp;
// remove keyframes out of range
Mlt::GeometryItem invalidItem;
bool foundInvalidItem = false;
while (!m_geometry->next_key(&invalidItem, maxframe - minframe)) {
foundInvalidItem = true;
m_geometry->remove(invalidItem.frame());
}
if (elem.attribute("fixed") == "1") {
// Keyframes are disabled
m_ui.widgetTimeWrapper->setHidden(true);
......@@ -221,6 +229,10 @@ void GeometryWidget::setupParam(const QDomElement elem, int minframe, int maxfra
slotPositionChanged(0, false);
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
// update if we had to remove a keyframe which got out of range
if (foundInvalidItem)
QTimer::singleShot(300, this, SIGNAL(parameterChanged()));
}
void GeometryWidget::slotSyncPosition(int relTimelinePos)
......@@ -237,13 +249,14 @@ void GeometryWidget::slotSyncPosition(int relTimelinePos)
void GeometryWidget::slotPositionChanged(int pos, bool seek)
{
if (pos == -1)
if (pos == -1) {
pos = m_timePos->getValue();
m_timePos->setValue(pos);
m_timeline->blockSignals(true);
m_timeline->setValue(pos);
m_timeline->blockSignals(false);
m_timeline->blockSignals(true);
m_timeline->setValue(pos);
m_timeline->blockSignals(false);
} else {
m_timePos->setValue(pos);
}
Mlt::GeometryItem item;
if (m_geometry->fetch(&item, pos) || item.key() == false) {
......
......@@ -219,6 +219,11 @@ void MonitorScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (!m_enabled)
return;
/*if (event->buttons() != Qt::NoButton && (event->screenPos() - m_screenClickPoint).manhattanLength() < QApplication::startDragDistance()) {
event->accept();
return;
}*/
QPointF mousePos = event->scenePos();
if (m_selectedItem && event->buttons() & Qt::LeftButton) {
......
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