From 6243e6fd489249474db06715cac69f8646f802ce Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sat, 30 Oct 2021 15:56:12 +0300 Subject: [PATCH] set max playback speed to 16 ;) --- plugins/playback-speed/front.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/playback-speed/front.js b/plugins/playback-speed/front.js index d56c31df..091c48c9 100644 --- a/plugins/playback-speed/front.js +++ b/plugins/playback-speed/front.js @@ -8,6 +8,7 @@ const slider = ElementFromFile(templatePath(__dirname, "slider.html")); const roundToTwo = (n) => Math.round( n * 1e2 ) / 1e2; const MIN_PLAYBACK_SPEED = 0.07; +const MAX_PLAYBACK_SPEED = 16; let playbackSpeed = 1; @@ -61,8 +62,9 @@ const setupSliderListeners = () => { } // e.deltaY < 0 means wheel-up playbackSpeed = roundToTwo(e.deltaY < 0 ? - playbackSpeed + 0.01 : - Math.max(playbackSpeed - 0.01, MIN_PLAYBACK_SPEED)); + math.min(playbackSpeed + 0.01, MAX_PLAYBACK_SPEED) : + Math.max(playbackSpeed - 0.01, MIN_PLAYBACK_SPEED) + ); updatePlayBackSpeed(); // update slider position