mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-26 20:51:48 +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) {
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user