clamp interval

This commit is contained in:
RickyRister 2026-07-23 00:58:41 -07:00
parent 2951b9f4cd
commit a488f3d0be
2 changed files with 3 additions and 1 deletions

View file

@ -10,6 +10,8 @@ ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : Settings
{ {
// fast forward speed // fast forward speed
fastForwardSpeedBox.setMinimum(1); fastForwardSpeedBox.setMinimum(1);
fastForwardSpeedBox.setMaximum(99.9);
fastForwardSpeedBox.setDecimals(1);
fastForwardSpeedBox.setValue(SettingsCache::instance().getFastForwardSpeed()); fastForwardSpeedBox.setValue(SettingsCache::instance().getFastForwardSpeed());
connect(&fastForwardSpeedBox, qOverload<double>(&QDoubleSpinBox::valueChanged), this, connect(&fastForwardSpeedBox, qOverload<double>(&QDoubleSpinBox::valueChanged), this,
&ReplayQuickSettingsWidget::actUpdateFastForwardSpeed); &ReplayQuickSettingsWidget::actUpdateFastForwardSpeed);

View file

@ -187,7 +187,7 @@ void ReplayTimelineWidget::processNewEvents(PlaybackMode playbackMode)
void ReplayTimelineWidget::setTimeScaleFactor(qreal _timeScaleFactor) void ReplayTimelineWidget::setTimeScaleFactor(qreal _timeScaleFactor)
{ {
timeScaleFactor = _timeScaleFactor; timeScaleFactor = _timeScaleFactor;
int interval = qRound(TIMER_INTERVAL_MS / timeScaleFactor); int interval = std::max(1, qRound(TIMER_INTERVAL_MS / timeScaleFactor));
replayTimer->setInterval(interval); replayTimer->setInterval(interval);
} }