]> git.sesse.net Git - kdenlive/commitdiff
* Fix wrong resizing in composite transition when using "Fit to width / height"
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Feb 2011 09:03:15 +0000 (09:03 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Feb 2011 09:03:15 +0000 (09:03 +0000)
* Proxy clip: do not fetch properties of the proxy (frame size, ...), use the one from original clip

svn path=/trunk/kdenlive/; revision=5406

src/geometrywidget.cpp
src/renderer.cpp
src/renderer.h

index 78f6c7231c22837315e985684f2af51bc6575398..6e3850758d6191c46fd2ebc18a7a2c87f09315b0 100644 (file)
@@ -550,24 +550,24 @@ void GeometryWidget::setFrameSize(QPoint size)
 void GeometryWidget::slotAdjustToFrameSize()
 {
     if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
-    m_spinWidth->setValue(m_frameSize.x());
+    m_spinWidth->setValue((int) (m_frameSize.x() / m_monitor->render->sar() + 0.5));
     m_spinHeight->setValue(m_frameSize.y());
 }
 
 void GeometryWidget::slotFitToWidth()
 {
     if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
-    double factor = (double) m_monitor->render->frameRenderWidth() / m_frameSize.x();
-    m_spinHeight->setValue(m_frameSize.y() * factor);
+    double factor = (double) m_monitor->render->frameRenderWidth() / m_frameSize.x() * m_monitor->render->sar();
+    m_spinHeight->setValue((int) (m_frameSize.y() * factor + 0.5));
     m_spinWidth->setValue(m_monitor->render->frameRenderWidth());
 }
 
 void GeometryWidget::slotFitToHeight()
 {
     if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
-    double factor = m_monitor->render->renderHeight() / m_frameSize.y();
+    double factor = (double) m_monitor->render->renderHeight() / m_frameSize.y();
     m_spinHeight->setValue(m_monitor->render->renderHeight());
-    m_spinWidth->setValue(m_frameSize.x() * factor);
+    m_spinWidth->setValue((int) (m_frameSize.x() / m_monitor->render->sar() * factor + 0.5));
 }
 
 #include "geometrywidget.moc"
index 7c110a10dabb64795540d861828b2a4d4486d3a3..90f733b9ebfe8008a3187a8dc351cde4295ad589 100644 (file)
@@ -463,6 +463,10 @@ double Render::dar() const
     return m_mltProfile->dar();
 }
 
+double Render::sar() const
+{
+    return m_mltProfile->sar();
+}
 
 void Render::slotSplitView(bool doit)
 {
@@ -630,7 +634,7 @@ void Render::getFileProperties(const QDomElement xml, const QString &clipId, int
     if (xml.hasAttribute("templatetext"))
         producer->set("templatetext", xml.attribute("templatetext").toUtf8().constData());
 
-    if (!replaceProducer && xml.hasAttribute("file_hash")) {
+    if ((!replaceProducer && xml.hasAttribute("file_hash")) || xml.hasAttribute("proxy")) {
         // Clip  already has all properties
         emit replyGetFileProperties(clipId, producer, QMap < QString, QString >(), QMap < QString, QString >(), replaceProducer, selectClip);
         return;
index 14a2186ec370d91c4fdbfbeea84ca9724487fae3..e8716dd0e7e773dd8ad250636d9ca911c758390f 100644 (file)
@@ -179,6 +179,8 @@ Q_OBJECT public:
 
     /** @brief Returns display aspect ratio. */
     double dar() const;
+    /** @brief Returns sample aspect ratio. */
+    double sar() const;
 
     /*
      * Playlist manipulation.