Commit 8a1fc777 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix title clip length 1 frame shorter than expected on creation

parent 5c9d4ead
Pipeline #3388 passed with stage
in 13 minutes and 23 seconds
......@@ -2650,7 +2650,7 @@ void Bin::showTitleWidget(const std::shared_ptr<ProjectClip> &clip)
if (dia_ui.exec() == QDialog::Accepted) {
QMap<QString, QString> newprops;
newprops.insert(QStringLiteral("xmldata"), dia_ui.xml().toString());
if (dia_ui.duration() != clip->duration().frames(pCore->getCurrentFps()) + 1) {
if (dia_ui.duration() != clip->duration().frames(pCore->getCurrentFps())) {
// duration changed, we need to update duration
newprops.insert(QStringLiteral("out"), clip->framesToTime(dia_ui.duration() - 1));
int currentLength = clip->getProducerDuration();
......
......@@ -264,7 +264,7 @@ void ClipCreationDialog::createTitleClip(KdenliveDoc *doc, const QString &parent
properties[QStringLiteral("xmldata")] = dia_ui->xml().toString();
QString titleSuggestion = dia_ui->titleSuggest();
ClipCreator::createTitleClip(properties, dia_ui->duration() - 1, titleSuggestion.isEmpty() ? i18n("Title clip") : titleSuggestion, parentFolder,
ClipCreator::createTitleClip(properties, dia_ui->duration(), titleSuggestion.isEmpty() ? i18n("Title clip") : titleSuggestion, parentFolder,
std::move(model));
}
delete dia_ui;
......
......@@ -2049,8 +2049,9 @@ int TitleWidget::getNewStuff(const QString &configFile)
QDomDocument TitleWidget::xml()
{
QDomDocument doc = m_titledocument.xml(m_startViewport, m_endViewport);
doc.documentElement().setAttribute(QStringLiteral("duration"), m_tc.getFrameCount(title_duration->text()));
doc.documentElement().setAttribute(QStringLiteral("out"), m_tc.getFrameCount(title_duration->text()));
int duration = m_tc.getFrameCount(title_duration->text());
doc.documentElement().setAttribute(QStringLiteral("duration"), duration);
doc.documentElement().setAttribute(QStringLiteral("out"), duration - 1);
return doc;
}
......
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