From cbca9ecf1f16000d550634836e2e596dd47d6d25 Mon Sep 17 00:00:00 2001 From: Rex Date: Tue, 8 Oct 2024 05:56:33 +0800 Subject: [PATCH] Fix bug --- src/gameobjects/text/GetTextSize.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gameobjects/text/GetTextSize.js b/src/gameobjects/text/GetTextSize.js index f1199174fe..26d5b017df 100644 --- a/src/gameobjects/text/GetTextSize.js +++ b/src/gameobjects/text/GetTextSize.js @@ -53,7 +53,10 @@ var GetTextSize = function (text, size, lines) lineWidth += context.measureText(line[j]).width; } - lineWidth += letterSpacing * (line.length - 1); + if (line.length > 1) + { + lineWidth += letterSpacing * (line.length - 1); + } } // Adjust for wrapped text