Skip to content

Commit 0a46d64

Browse files
committed
Remove extra space in each line end
Add space only when the word index is greater than last one.
1 parent 9a97451 commit 0a46d64

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/gameobjects/text/static/Text.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,11 @@ var Text = new Class({
462462
else
463463
{
464464
spaceLeft -= wordWidthWithSpace;
465-
result += words[j] + ' ';
465+
result += words[j];
466+
if (j < (words.length -1))
467+
{
468+
result += ' ';
469+
}
466470
}
467471
}
468472

0 commit comments

Comments
 (0)