fix(web): danmaku density range 0.1-1 per product ruling
This commit is contained in:
parent
f96afbc4b5
commit
728a576a4f
|
|
@ -24,7 +24,7 @@ function readSettings(): DanmakuSettings {
|
|||
return {
|
||||
enabled,
|
||||
opacity: Math.min(1, Math.max(0, opacityRaw)),
|
||||
density: Math.min(3, Math.max(0.1, densityRaw)),
|
||||
density: Math.min(1, Math.max(0.1, densityRaw)),
|
||||
};
|
||||
} catch {
|
||||
return FALLBACK;
|
||||
|
|
@ -79,7 +79,7 @@ function Inner(props: { locale: Locale }) {
|
|||
<input
|
||||
type="range"
|
||||
min={0.1}
|
||||
max={3}
|
||||
max={1}
|
||||
step={0.1}
|
||||
value={density}
|
||||
onChange={(e) => setDensity(Number(e.target.value))}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function readDanmakuPrefs(): DanmakuPrefs {
|
|||
return {
|
||||
enabled,
|
||||
opacity: Math.min(1, Math.max(0, opacityRaw)),
|
||||
density: Math.min(3, Math.max(0.1, densityRaw)),
|
||||
density: Math.min(1, Math.max(0.1, densityRaw)),
|
||||
};
|
||||
} catch {
|
||||
return fallback;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export const danmakuSchemas = {
|
|||
settings: z.object({
|
||||
enabled: z.boolean().default(true),
|
||||
opacity: z.number().min(0).max(1).default(0.8),
|
||||
density: z.number().min(0.1).max(3).default(1),
|
||||
density: z.number().min(0.1).max(1).default(1),
|
||||
}),
|
||||
getSettings: z.object({}).optional(),
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue