diff --git a/src/stores/subtitles/index.ts b/src/stores/subtitles/index.ts index e7f0aa26..0d89763f 100644 --- a/src/stores/subtitles/index.ts +++ b/src/stores/subtitles/index.ts @@ -67,9 +67,15 @@ export const useSubtitleStore = create( updateStyling(newStyling) { set((s) => { if (newStyling.backgroundOpacity !== undefined) - s.styling.backgroundOpacity = newStyling.backgroundOpacity; + s.styling.backgroundOpacity = Math.min( + 1, + Math.max(0, newStyling.backgroundOpacity), + ); if (newStyling.backgroundBlur !== undefined) - s.styling.backgroundBlur = Math.min(1, newStyling.backgroundBlur); + s.styling.backgroundBlur = Math.min( + 1, + Math.max(0, newStyling.backgroundBlur), + ); if (newStyling.color !== undefined) s.styling.color = newStyling.color.toLowerCase(); if (newStyling.size !== undefined)