更新弹幕demo

This commit is contained in:
Harvey Zack committed 2022-05-15 19:41:12 +08:00
1 parent e8d721f92f
commit c3f092dc2a
5 files changed
+218 -95

No files matched your search

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