Skip to content

Commit

Permalink
Fix calculation of idx in GetBitmapTextSize
Browse files Browse the repository at this point in the history
  • Loading branch information
bagyoni committed Oct 12, 2024
1 parent 21efdc5 commit 9525431
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gameobjects/bitmaptext/GetBitmapTextSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -170,6 +172,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
}
}

wrappedLine = wrappedLine.slice(0, -1);
wrappedLine += (wrappedLine ? '\n' : '') + lineToCheck;
wrappedLines.push(wrappedLine);
}
Expand Down

0 comments on commit 9525431

Please sign in to comment.