Skip to content

Commit

Permalink
Merge pull request #109 from xpadev-net/fix/comment-not-rendered
Browse files Browse the repository at this point in the history
[修正] コメント数が1のときにコメントが表示されなくなる
  • Loading branch information
xpadev-net authored Aug 14, 2024
2 parents c2b5e62 + bd65204 commit 1e13dbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class NiconiComments {
right: [],
};
this.lastVpos = -1;
this.processedCommentIndex = 0;
this.processedCommentIndex = -1;

this.comments = this.preRendering(parsedData);

Expand Down Expand Up @@ -197,7 +197,7 @@ class NiconiComments {
private getCommentPos(data: IComment[], end: number, lazy = false) {
const getCommentPosStart = performance.now();
if (this.processedCommentIndex + 1 >= end) return;
for (const comment of data.slice(this.processedCommentIndex, end)) {
for (const comment of data.slice(this.processedCommentIndex + 1, end)) {
if (comment.invisible || (comment.posY > -1 && !lazy)) continue;
if (comment.loc === "naka") {
processMovableComment(comment, this.collision, this.timeline, lazy);
Expand Down

0 comments on commit 1e13dbf

Please sign in to comment.