mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
Merge pull request #5367 from rexrainbow/bugfix-text.basicWordWrap
Don't add white space when measure last word of a line
This commit is contained in:
commit
401487d4b1
1 changed files with 6 additions and 1 deletions
|
@ -520,7 +520,12 @@ var Text = new Class({
|
|||
{
|
||||
var word = words[j];
|
||||
var wordWidth = context.measureText(word).width;
|
||||
var wordWidthWithSpace = wordWidth + whiteSpaceWidth;
|
||||
var wordWidthWithSpace = wordWidth;
|
||||
|
||||
if (j < lastWordIndex)
|
||||
{
|
||||
wordWidthWithSpace += whiteSpaceWidth;
|
||||
}
|
||||
|
||||
if (wordWidthWithSpace > spaceLeft)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue