From bd65204907479b6d3a39bd7393b794ee3e5d5492 Mon Sep 17 00:00:00 2001 From: XPA Date: Thu, 15 Aug 2024 01:18:04 +0900 Subject: [PATCH 1/2] 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); From ca5b29977827cef28463b7ffedbe21b60db11c0f Mon Sep 17 00:00:00 2001 From: XPA Date: Thu, 15 Aug 2024 01:20:45 +0900 Subject: [PATCH 2/2] release: v0.2.72 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 71c34175..4e6be741 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xpadev-net/niconicomments", - "version": "0.2.71", + "version": "0.2.72", "description": "NiconiComments is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.", "main": "dist/bundle.js", "types": "dist/bundle.d.ts",