From: Till Theato Date: Wed, 10 Aug 2011 08:51:42 +0000 (+0000) Subject: Fix 'adjust to original size' and 'fit to width/height' for title and color clips... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f43e6d014193d7a7cf44461a128d3f0876a9fa03;p=kdenlive Fix 'adjust to original size' and 'fit to width/height' for title and color clips in geometry widget. svn path=/trunk/kdenlive/; revision=5827 --- diff --git a/CHANGELOG b/CHANGELOG index 8a5a3575..36260b48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ HEAD * Allow use of different ffmpeg preset for 1st and 2nd render pass. * Notes widget: context menu now allows to insert clickable timecode to make easy reference to some place in the project. + * Fix 'adjust to original size' and 'fit to width/height' for title and color clips in geometry widget (pan and zoom, composite, affine). * Fix possible crash in DVD wizard chapters. (http://kdenlive.org/mantis/view.php?id=2264) * Do not duplicate effect stack after split audio but move audio effects only. * Fix issues related to the usage of comma as numeric separator in some locales. diff --git a/src/geometrywidget.cpp b/src/geometrywidget.cpp index 04fe9085..65d04259 100644 --- a/src/geometrywidget.cpp +++ b/src/geometrywidget.cpp @@ -711,7 +711,9 @@ void GeometryWidget::setFrameSize(QPoint size) void GeometryWidget::slotAdjustToFrameSize() { - if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight()); + if (m_frameSize == QPoint() || m_frameSize.x() == 0 || m_frameSize.y() == 0) { + m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight()); + } m_spinWidth->blockSignals(true); m_spinHeight->blockSignals(true); m_spinWidth->setValue((int) (m_frameSize.x() / m_monitor->render->sar() + 0.5)); @@ -723,7 +725,9 @@ void GeometryWidget::slotAdjustToFrameSize() void GeometryWidget::slotFitToWidth() { - if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight()); + if (m_frameSize == QPoint() || m_frameSize.x() == 0 || m_frameSize.y() == 0) { + m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight()); + } double factor = (double) m_monitor->render->frameRenderWidth() / m_frameSize.x() * m_monitor->render->sar(); m_spinWidth->blockSignals(true); m_spinHeight->blockSignals(true); @@ -736,7 +740,9 @@ void GeometryWidget::slotFitToWidth() void GeometryWidget::slotFitToHeight() { - if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight()); + if (m_frameSize == QPoint() || m_frameSize.x() == 0 || m_frameSize.y() == 0) { + m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight()); + } double factor = (double) m_monitor->render->renderHeight() / m_frameSize.y(); m_spinWidth->blockSignals(true); m_spinHeight->blockSignals(true);