mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Removed empty line spacing added when text is undefined. Fix #6807
This commit is contained in:
parent
a3470a08e5
commit
cc0bac0214
1 changed files with 9 additions and 6 deletions
|
@ -263,10 +263,12 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
|
||||
for (i = crs.length - 1; i >= 0; i--)
|
||||
{
|
||||
// eslint-disable-next-line quotes
|
||||
text = stringInsert(text, crs[i], "\n");
|
||||
if (crs[i] > -1)
|
||||
{
|
||||
text = stringInsert(text, crs[i], "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
out.wrappedText = text;
|
||||
|
||||
textLength = text.length;
|
||||
|
@ -298,8 +300,6 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
current = null;
|
||||
}
|
||||
|
||||
xAdvance = 0;
|
||||
yAdvance = (lineHeight + lineSpacing) * (currentLine + 1);
|
||||
lastGlyph = null;
|
||||
|
||||
lineWidths[currentLine] = currentLineWidth;
|
||||
|
@ -317,6 +317,9 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
currentLine++;
|
||||
currentLineWidth = 0;
|
||||
|
||||
xAdvance = 0;
|
||||
yAdvance = (lineHeight + lineSpacing) * currentLine;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -522,4 +525,4 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
return out;
|
||||
};
|
||||
|
||||
module.exports = GetBitmapTextSize;
|
||||
module.exports = GetBitmapTextSize;
|
||||
|
|
Loading…
Reference in a new issue