From c29542f7e41c202ca18bb529c87a52d8bb5d680c Mon Sep 17 00:00:00 2001 From: Pablo Gil Date: Tue, 12 Nov 2024 10:50:29 +0100 Subject: [PATCH] simplified the conversion --- src/ui/dialogs/scenesettingsdialog.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ui/dialogs/scenesettingsdialog.cpp b/src/ui/dialogs/scenesettingsdialog.cpp index 4e8c657b0..2802ce73a 100644 --- a/src/ui/dialogs/scenesettingsdialog.cpp +++ b/src/ui/dialogs/scenesettingsdialog.cpp @@ -314,7 +314,6 @@ void SceneSettingsDialog::sNewSceneDialog(Document& document, void SceneSettingsDialog::updateDuration() { const QString typetime = mTypeTime->currentData().toString(); const qreal fps = mFPSSpinBox->value(); - int duration = mMaxFrameSpin->value() - mMinFrameSpin->value(); int index = mTypeTime->currentIndex(); if (mMinFrameSpin->value() >= mMaxFrameSpin->value()) { @@ -323,14 +322,14 @@ void SceneSettingsDialog::updateDuration() { switch(index) { case 0: // Convert seconds to frames - duration = qRound(duration * fps); + mMinFrameSpin->setValue(mMinFrameSpin->value() * fps); + mMaxFrameSpin->setValue(mMaxFrameSpin->value() * fps); break; case 1: // Convert frames to seconds - duration = qRound(duration / fps); + mMinFrameSpin->setValue(mMinFrameSpin->value() / fps); + mMaxFrameSpin->setValue(mMaxFrameSpin->value() / fps); break; default: return; } - - mMaxFrameSpin->setValue(mMinFrameSpin->value() + duration); }