mirror of
https://github.com/sussy-code/smov.git
synced 2025-01-01 16:37:39 +01:00
Go back to using percentages instead of pixels
This commit is contained in:
parent
e09c04b57b
commit
ca180ab9ea
4 changed files with 10 additions and 17 deletions
|
@ -264,15 +264,11 @@ export function CaptionSettingsView({ id }: { id: string }) {
|
||||||
/>
|
/>
|
||||||
<CaptionSetting
|
<CaptionSetting
|
||||||
label={t("settings.subtitles.backgroundBlurLabel")}
|
label={t("settings.subtitles.backgroundBlurLabel")}
|
||||||
max={64}
|
max={100}
|
||||||
min={0}
|
min={0}
|
||||||
onChange={(v) =>
|
onChange={(v) => updateStyling({ backgroundBlur: v / 100 })}
|
||||||
updateStyling({
|
value={styling.backgroundBlur * 100}
|
||||||
backgroundBlur: Math.round(v / 4) * 4,
|
textTransformer={(s) => `${s}%`}
|
||||||
})
|
|
||||||
}
|
|
||||||
value={styling.backgroundBlur}
|
|
||||||
textTransformer={(s) => `${s}px`}
|
|
||||||
/>
|
/>
|
||||||
<CaptionSetting
|
<CaptionSetting
|
||||||
label={t("settings.subtitles.textSizeLabel")}
|
label={t("settings.subtitles.textSizeLabel")}
|
||||||
|
|
|
@ -57,7 +57,7 @@ export function CaptionCue({
|
||||||
backgroundColor: `rgba(0,0,0,${styling.backgroundOpacity.toFixed(2)})`,
|
backgroundColor: `rgba(0,0,0,${styling.backgroundOpacity.toFixed(2)})`,
|
||||||
backdropFilter:
|
backdropFilter:
|
||||||
styling.backgroundBlur !== 0
|
styling.backgroundBlur !== 0
|
||||||
? `blur(${styling.backgroundBlur}px)`
|
? `blur(${Math.floor(styling.backgroundBlur * 64)}px)`
|
||||||
: "none",
|
: "none",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -94,16 +94,13 @@ export function CaptionsPart(props: {
|
||||||
/>
|
/>
|
||||||
<CaptionSetting
|
<CaptionSetting
|
||||||
label={t("settings.subtitles.backgroundBlurLabel")}
|
label={t("settings.subtitles.backgroundBlurLabel")}
|
||||||
max={64}
|
max={100}
|
||||||
min={0}
|
min={0}
|
||||||
onChange={(v) =>
|
onChange={(v) =>
|
||||||
props.setStyling({
|
props.setStyling({ ...props.styling, backgroundBlur: v / 100 })
|
||||||
...props.styling,
|
|
||||||
backgroundBlur: Math.round(v / 4) * 4,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
value={props.styling.backgroundBlur}
|
value={props.styling.backgroundBlur * 100}
|
||||||
textTransformer={(s) => `${s}px`}
|
textTransformer={(s) => `${s}%`}
|
||||||
/>
|
/>
|
||||||
<CaptionSetting
|
<CaptionSetting
|
||||||
label={t("settings.subtitles.textSizeLabel")}
|
label={t("settings.subtitles.textSizeLabel")}
|
||||||
|
|
|
@ -19,7 +19,7 @@ export interface SubtitleStyling {
|
||||||
backgroundOpacity: number;
|
backgroundOpacity: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* background blur, ranges between 0 and 64
|
* background blur, ranges between 0 and 1
|
||||||
*/
|
*/
|
||||||
backgroundBlur: number;
|
backgroundBlur: number;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue