From 6101e25ca94a5f7fe4fbfd97d4a612e177046d7f Mon Sep 17 00:00:00 2001 From: photonstorm Date: Sun, 9 Feb 2014 23:52:30 +0000 Subject: [PATCH] Fixes a rogue new-line character on the end of Text objects that have word wrapping enabled (causing the Text bounds to be 1 line too high). --- src/pixi/text/Text.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pixi/text/Text.js b/src/pixi/text/Text.js index 5244ca2..d2cf186 100644 --- a/src/pixi/text/Text.js +++ b/src/pixi/text/Text.js @@ -287,7 +287,11 @@ PIXI.Text.prototype.wordWrap = function(text) result += words[j] + ' '; } } - result += '\n'; + + if (i < lines.length-1) + { + result += '\n'; + } } return result; };