mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-27 12:41:53 +01:00
fix: add minimums & maximums for other settings
This commit is contained in:
parent
35c9c85b86
commit
7c5c5daf5c
@ -67,9 +67,15 @@ export const useSubtitleStore = create(
|
|||||||
updateStyling(newStyling) {
|
updateStyling(newStyling) {
|
||||||
set((s) => {
|
set((s) => {
|
||||||
if (newStyling.backgroundOpacity !== undefined)
|
if (newStyling.backgroundOpacity !== undefined)
|
||||||
s.styling.backgroundOpacity = newStyling.backgroundOpacity;
|
s.styling.backgroundOpacity = Math.min(
|
||||||
|
1,
|
||||||
|
Math.max(0, newStyling.backgroundOpacity),
|
||||||
|
);
|
||||||
if (newStyling.backgroundBlur !== undefined)
|
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)
|
if (newStyling.color !== undefined)
|
||||||
s.styling.color = newStyling.color.toLowerCase();
|
s.styling.color = newStyling.color.toLowerCase();
|
||||||
if (newStyling.size !== undefined)
|
if (newStyling.size !== undefined)
|
||||||
|
Loading…
Reference in New Issue
Block a user