mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
fix: add minimums & maximums for other settings
This commit is contained in:
parent
35c9c85b86
commit
7c5c5daf5c
1 changed files with 8 additions and 2 deletions
|
@ -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 a new issue