更新弹幕demo

This commit is contained in:
Harvey Zack committed 2022-05-15 18:59:33 +08:00
1 parent 3f4ceefbc7
commit e8d721f92f
4 files changed
+95 -218

No files matched your search

@@ -85,12 +85,12 @@ export default class Danmuku {
const { clientHeight } = this.$player;
if (typeof value === 'number') {
return clamp(value, 0, clientHeight);
return clamp(value, 10, clientHeight);
}
if (typeof value === 'string' && value.endsWith('%')) {
const ratio = parseFloat(value) / 100;
return clamp(clientHeight * ratio, 0, clientHeight);
return clamp(clientHeight * ratio, 10, clientHeight);
}
return Danmuku.option.margin[0];
@@ -102,12 +102,12 @@ export default class Danmuku {
const { clientHeight } = this.$player;
if (typeof value === 'number') {
return clamp(value, 0, clientHeight);
return clamp(value, 10, clientHeight);
}
if (typeof value === 'string' && value.endsWith('%')) {
const ratio = parseFloat(value) / 100;
return clamp(clientHeight * ratio, 0, clientHeight);
return clamp(clientHeight * ratio, 10, clientHeight);
}
return Danmuku.option.margin[1];