Skip to content

Commit

Permalink
simplified the conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
pgilfernandez committed Nov 12, 2024
1 parent 63c8ddd commit c29542f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ui/dialogs/scenesettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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);
}

0 comments on commit c29542f

Please sign in to comment.