mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix bugs
This commit is contained in:
parent
6ba3182da8
commit
23fd922613
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
min/danmaku-converter.min.js
vendored
2
min/danmaku-converter.min.js
vendored
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@
|
|||||||
constructor(content, time, type, fontSize, color)
|
constructor(content, time, type, fontSize, color)
|
||||||
{
|
{
|
||||||
this.content = content;
|
this.content = content;
|
||||||
this.time = parseFloat(time);
|
this.time = time;
|
||||||
this.type = parseInt(type);
|
this.type = parseInt(type);
|
||||||
this.fontSize = parseFloat(fontSize);
|
this.fontSize = parseFloat(fontSize);
|
||||||
this.color = parseInt(color);
|
this.color = parseInt(color);
|
||||||
@ -22,6 +22,7 @@
|
|||||||
this.pool = parseInt(pool);
|
this.pool = parseInt(pool);
|
||||||
this.userHash = userHash;
|
this.userHash = userHash;
|
||||||
this.rowId = parseInt(rowId);
|
this.rowId = parseInt(rowId);
|
||||||
|
this.time = parseFloat(this.time);
|
||||||
this.pDataArray = [time, type, fontSize, color, timeStamp, pool, userHash, rowId];
|
this.pDataArray = [time, type, fontSize, color, timeStamp, pool, userHash, rowId];
|
||||||
}
|
}
|
||||||
text()
|
text()
|
||||||
@ -156,10 +157,12 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|||||||
closestDanmaku = this.horizontalTrack.find(it => it.track === track && it.end > danmaku.time);
|
closestDanmaku = this.horizontalTrack.find(it => it.track === track && it.end > danmaku.time);
|
||||||
track++;
|
track++;
|
||||||
}
|
}
|
||||||
while (closestDanmaku &&
|
// 当前轨道不能放弹幕的条件
|
||||||
closestDanmaku.start < danmaku.time &&
|
while (closestDanmaku && (
|
||||||
closestDanmaku.halfWidth > width &&
|
closestDanmaku.start < danmaku.time ||
|
||||||
|
closestDanmaku.width < width) &&
|
||||||
track <= this.trackCount);
|
track <= this.trackCount);
|
||||||
|
|
||||||
// 如果弹幕过多, 此条就不显示了
|
// 如果弹幕过多, 此条就不显示了
|
||||||
if (track > this.trackCount)
|
if (track > this.trackCount)
|
||||||
{
|
{
|
||||||
@ -167,7 +170,7 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|||||||
}
|
}
|
||||||
track--; // 减回最后的自增
|
track--; // 减回最后的自增
|
||||||
this.horizontalTrack.push({
|
this.horizontalTrack.push({
|
||||||
halfWidth: x,
|
width: width,
|
||||||
start: danmaku.time,
|
start: danmaku.time,
|
||||||
end: danmaku.time + time,
|
end: danmaku.time + time,
|
||||||
track: track
|
track: track
|
||||||
@ -288,10 +291,6 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|||||||
}
|
}
|
||||||
convertTime(startTime, duration)
|
convertTime(startTime, duration)
|
||||||
{
|
{
|
||||||
function round(number)
|
|
||||||
{
|
|
||||||
return Math.round(number * 100) / 100;
|
|
||||||
}
|
|
||||||
function secondsToTime(seconds)
|
function secondsToTime(seconds)
|
||||||
{
|
{
|
||||||
let hours = 0;
|
let hours = 0;
|
||||||
@ -306,7 +305,7 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|||||||
minutes -= 60;
|
minutes -= 60;
|
||||||
hours++;
|
hours++;
|
||||||
}
|
}
|
||||||
return `${hours}:${minutes.toString().padStart(2, "0")}:${round(seconds).toString().padStart(4, "0")}`;
|
return `${hours}:${minutes}:${seconds}`;
|
||||||
}
|
}
|
||||||
return [secondsToTime(startTime), secondsToTime(startTime + duration)];
|
return [secondsToTime(startTime), secondsToTime(startTime + duration)];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user