mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Fix calculation of idx in GetBitmapTextSize
This commit is contained in:
parent
21efdc57e7
commit
95254316b3
1 changed files with 3 additions and 0 deletions
|
@ -162,6 +162,8 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
else
|
||||
{
|
||||
// If the current word is too long to fit on a line, wrap it
|
||||
// Remove trailing word wrap char to keep text length the same
|
||||
wrappedLine = wrappedLine.slice(0, -1);
|
||||
wrappedLine += (wrappedLine ? '\n' : '') + lineToCheck;
|
||||
lineToCheck = word;
|
||||
}
|
||||
|
@ -170,6 +172,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
}
|
||||
}
|
||||
|
||||
wrappedLine = wrappedLine.slice(0, -1);
|
||||
wrappedLine += (wrappedLine ? '\n' : '') + lineToCheck;
|
||||
wrappedLines.push(wrappedLine);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue