From bd65204907479b6d3a39bd7393b794ee3e5d5492 Mon Sep 17 00:00:00 2001 From: XPA Date: Thu, 15 Aug 2024 01:18:04 +0900 Subject: [PATCH] fix: comment not rendered when comment size is 1 --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 7e7a85d5..4941a565 100755 --- a/src/main.ts +++ b/src/main.ts @@ -141,7 +141,7 @@ class NiconiComments { right: [], }; this.lastVpos = -1; - this.processedCommentIndex = 0; + this.processedCommentIndex = -1; this.comments = this.preRendering(parsedData); @@ -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);