mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Don't reset text
This commit is contained in:
parent
a7b3cd585d
commit
4a33c7b5c8
2 changed files with 12 additions and 6 deletions
|
@ -68,11 +68,14 @@ var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage,
|
||||||
var lineOffsetX = 0;
|
var lineOffsetX = 0;
|
||||||
|
|
||||||
// Update the bounds - skipped internally if not dirty
|
// Update the bounds - skipped internally if not dirty
|
||||||
src.getTextBounds(false);
|
var bounds = src.getTextBounds(false);
|
||||||
|
|
||||||
// In case the method above changed it (word wrapping)
|
// In case the method above changed it (word wrapping)
|
||||||
text = src._text;
|
if (src.maxWidth > 0)
|
||||||
textLength = text.length;
|
{
|
||||||
|
text = bounds.wrappedText;
|
||||||
|
textLength = text.length;
|
||||||
|
}
|
||||||
|
|
||||||
var lineData = src._bounds.lines;
|
var lineData = src._bounds.lines;
|
||||||
|
|
||||||
|
|
|
@ -101,11 +101,14 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
|
||||||
var lineOffsetX = 0;
|
var lineOffsetX = 0;
|
||||||
|
|
||||||
// Update the bounds - skipped internally if not dirty
|
// Update the bounds - skipped internally if not dirty
|
||||||
src.getTextBounds(false);
|
var bounds = src.getTextBounds(false);
|
||||||
|
|
||||||
// In case the method above changed it (word wrapping)
|
// In case the method above changed it (word wrapping)
|
||||||
text = src._text;
|
if (src.maxWidth > 0)
|
||||||
textLength = text.length;
|
{
|
||||||
|
text = bounds.wrappedText;
|
||||||
|
textLength = text.length;
|
||||||
|
}
|
||||||
|
|
||||||
var lineData = src._bounds.lines;
|
var lineData = src._bounds.lines;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue