Commit 2a0c0d91 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Cleanup & fix titled background distorted.

Fixes #482
parent b18469b8
......@@ -2783,16 +2783,6 @@ void Bin::slotGotFilterJobResults(const QString &id, int startPos, int track, co
}
*/
void Bin::slotGetCurrentProjectImage(const QString &clipId, bool request)
{
Q_UNUSED(clipId)
// TODO refact : look at this
// if (!clipId.isEmpty()) {
// (pCore->projectManager()->currentTimeline()->hideClip(clipId, request));
// }
pCore->monitorManager()->projectMonitor()->slotGetCurrentImage(request);
}
// TODO: move title editing into a better place...
void Bin::showTitleWidget(const std::shared_ptr<ProjectClip> &clip)
{
......@@ -2800,7 +2790,6 @@ void Bin::showTitleWidget(const std::shared_ptr<ProjectClip> &clip)
QDir titleFolder(m_doc->projectDataFolder() + QStringLiteral("/titles"));
titleFolder.mkpath(QStringLiteral("."));
TitleWidget dia_ui(QUrl(), m_doc->timecode(), titleFolder.absolutePath(), pCore->monitorManager()->projectMonitor(), pCore->window());
connect(&dia_ui, &TitleWidget::requestBackgroundFrame, this, &Bin::slotGetCurrentProjectImage);
QDomDocument doc;
QString xmldata = clip->getProducerProperty(QStringLiteral("xmldata"));
if (xmldata.isEmpty() && QFile::exists(path)) {
......
......@@ -338,11 +338,6 @@ public slots:
void slotUpdateClipProperties(const QString &id, const QMap<QString, QString> &properties, bool refreshPropertiesPanel);
/** @brief Add effect to active Bin clip (used when double clicking an effect in list). */
void slotAddEffect(QString id, const QStringList &effectData);
/** @brief Request current frame from project monitor.
* @param clipId is the id of a clip we want to hide from screenshot
* @param request true to start capture process, false to end it. It is necessary to emit a false after image is received
**/
void slotGetCurrentProjectImage(const QString &clipId, bool request);
void slotExpandUrl(const ItemInfo &info, const QString &url, QUndoCommand *command);
/** @brief Abort all ongoing operations to prepare close. */
void abortOperations();
......
......@@ -256,7 +256,6 @@ void ClipCreationDialog::createTitleClip(KdenliveDoc *doc, const QString &parent
dir.mkpath(QStringLiteral("."));
QPointer<TitleWidget> dia_ui =
new TitleWidget(QUrl::fromLocalFile(templatePath), doc->timecode(), dir.absolutePath(), pCore->getMonitor(Kdenlive::ProjectMonitor), pCore->bin());
QObject::connect(dia_ui.data(), &TitleWidget::requestBackgroundFrame, pCore->bin(), &Bin::slotGetCurrentProjectImage);
if (dia_ui->exec() == QDialog::Accepted) {
// Ready, create clip xml
std::unordered_map<QString, QString> properties;
......
......@@ -580,7 +580,7 @@ void GLWidget::paintGL()
QOpenGLFramebufferObjectFormat fmt;
fmt.setSamples(1);
fmt.setInternalTextureFormat(GL_RGB); // GL_RGBA32F); // which one is the fastest ?
m_fbo = new QOpenGLFramebufferObject(m_profileSize.height(), m_profileSize.height(), fmt); // GL_TEXTURE_2D);
m_fbo = new QOpenGLFramebufferObject(m_profileSize.width(), m_profileSize.height(), fmt); // GL_TEXTURE_2D);
}
m_fbo->bind();
glViewport(0, 0, m_profileSize.width(), m_profileSize.height());
......
......@@ -211,6 +211,7 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, QString projectTit
connect(origin_y_top, &QAbstractButton::clicked, this, &TitleWidget::slotOriginYClicked);
connect(monitor, &Monitor::frameUpdated, this, &TitleWidget::slotGotBackground);
connect(this, &TitleWidget::requestBackgroundFrame, monitor, &Monitor::slotGetCurrentImage);
// Position and size
connect(value_w, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this](int){slotValueChanged(ValueWidth);});
......@@ -879,7 +880,7 @@ void TitleWidget::displayBackgroundFrame()
}
}
} else {
emit requestBackgroundFrame(m_clipId, true);
emit requestBackgroundFrame(true);
}
}
......@@ -887,7 +888,7 @@ void TitleWidget::slotGotBackground(const QImage &img)
{
QRectF r = m_frameBorder->sceneBoundingRect();
m_frameImage->setPixmap(QPixmap::fromImage(img.scaled(r.width() / 2, r.height() / 2)));
emit requestBackgroundFrame(m_clipId, false);
emit requestBackgroundFrame(false);
}
void TitleWidget::initAnimation()
......
......@@ -373,7 +373,7 @@ private slots:
void showMissingItems();
signals:
void requestBackgroundFrame(const QString &clipId, bool request);
void requestBackgroundFrame(bool request);
};
#endif
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