diff --git a/src/core/text/TextMetrics.js b/src/core/text/TextMetrics.js index cf0ce29..d36d204 100644 --- a/src/core/text/TextMetrics.js +++ b/src/core/text/TextMetrics.js @@ -246,8 +246,10 @@ width = 0; } - // give it its own line - lines += TextMetrics.addLine(token); + const isLastToken = i === tokens.length - 1; + + // give it its own line if it's not the end + lines += TextMetrics.addLine(token, !isLastToken); canPrependSpaces = false; line = ''; width = 0;