From 79d2114826d8f11ff7cd91217b1781ae28538f97 Mon Sep 17 00:00:00 2001 From: spessasus Date: Wed, 10 Jul 2024 01:52:00 +0200 Subject: [PATCH] fix sliders and renderer disabling on animation --- src/website/js/settings_ui/saving/load_settings.js | 8 ++++++-- src/website/js/settings_ui/settings.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/website/js/settings_ui/saving/load_settings.js b/src/website/js/settings_ui/saving/load_settings.js index 3dd0c002..82313c1c 100644 --- a/src/website/js/settings_ui/saving/load_settings.js +++ b/src/website/js/settings_ui/saving/load_settings.js @@ -26,10 +26,12 @@ export async function _loadSettings() // note falling time renderer.noteFallingTimeMs = rendererValues.noteFallingTimeMs; rendererControls.noteTimeSlider.value = rendererValues.noteFallingTimeMs; + rendererControls.noteTimeSlider.dispatchEvent(new Event('input')); getSpan(rendererControls.noteTimeSlider).innerText = `${rendererValues.noteFallingTimeMs}ms` // waveform line thickness - rendererControls.analyserThicknessSlider.value = rendererValues.waveformThickness + rendererControls.analyserThicknessSlider.value = rendererValues.waveformThickness; + rendererControls.analyserThicknessSlider.dispatchEvent(new Event('input')); renderer.lineThickness = rendererValues.waveformThickness; getSpan(rendererControls.analyserThicknessSlider).innerText = `${rendererValues.waveformThickness}px`; @@ -37,6 +39,7 @@ export async function _loadSettings() let value = rendererValues.sampleSize; // Math.pow(2, parseInt(rendererControls.analyserFftSlider.value)); we need to invert this rendererControls.analyserFftSlider.value = Math.log2(value); + rendererControls.analyserFftSlider.dispatchEvent(new Event('input')); renderer.normalAnalyserFft = value; renderer.drumAnalyserFft = Math.pow(2, Math.min(15, Math.log2(value) + 2)); renderer.updateFftSize(); @@ -45,7 +48,8 @@ export async function _loadSettings() // wave multiplier renderer.waveMultiplier = rendererValues.amplifier; rendererControls.waveMultiplierSlizer.value = rendererValues.amplifier; - getSpan(rendererControls.waveMultiplierSlizer).innerText = rendererValues.amplifier; + rendererControls.waveMultiplierSlizer.dispatchEvent(new Event('input')); + getSpan(rendererControls.waveMultiplierSlizer).innerText = rendererValues.amplifier.toString(); // render waveforms let controls = this.htmlControls.renderer; diff --git a/src/website/js/settings_ui/settings.js b/src/website/js/settings_ui/settings.js index 933643d7..fc7e6bb0 100644 --- a/src/website/js/settings_ui/settings.js +++ b/src/website/js/settings_ui/settings.js @@ -171,8 +171,8 @@ class SpessaSynthSettings toggleMusicPlayerMode() { - this.renderer.renderBool = !this.musicMode.visible; this.musicMode.setVisibility(!this.musicMode.visible, this.renderer.canvas, this.midiKeyboard.keyboard); + this.renderer.renderBool = !this.musicMode.visible; } hideTopPart()