From 19eac8d01a1febe8c2bafb9eb1e12dceae458adf Mon Sep 17 00:00:00 2001 From: xpadev Date: Mon, 30 Oct 2023 14:43:20 +0900 Subject: [PATCH] fix: line counter --- src/utils/flashText.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/flashText.ts b/src/utils/flashText.ts index 09d91450..f9c4ed79 100644 --- a/src/utils/flashText.ts +++ b/src/utils/flashText.ts @@ -254,7 +254,7 @@ const measure = ( const widths = []; context.font = parseFont(getValue(item.font, comment.font), comment.size); if (item.type === "normal") { - const lines = item.content.split(/[\n\r]/); + const lines = item.content.replace(/\r\n?/g, "\n").split(/\n/); let count = 0; for (const value of lines) { const measure = context.measureText(value);