Don't reset text

This commit is contained in:
Richard Davey 2019-11-22 16:43:13 +00:00
parent a7b3cd585d
commit 4a33c7b5c8
2 changed files with 12 additions and 6 deletions

View file

@ -68,11 +68,14 @@ var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage,
var lineOffsetX = 0;
// 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)
text = src._text;
if (src.maxWidth > 0)
{
text = bounds.wrappedText;
textLength = text.length;
}
var lineData = src._bounds.lines;

View file

@ -101,11 +101,14 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
var lineOffsetX = 0;
// 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)
text = src._text;
if (src.maxWidth > 0)
{
text = bounds.wrappedText;
textLength = text.length;
}
var lineData = src._bounds.lines;