@@ -357,9 +357,10 @@ Phaser.Text.prototype.updateText = function () {
357357
358358 var outputText = this . text ;
359359
360- // word wrap
361- // preserve original text
362- if ( this . style . wordWrap ) outputText = this . wordWrap ( this . text ) ;
360+ if ( this . style . wordWrap )
361+ {
362+ outputText = this . wordWrap ( this . text ) ;
363+ }
363364
364365 //split text into lines
365366 var lines = outputText . split ( / (?: \r \n | \r | \n ) / ) ;
@@ -368,6 +369,7 @@ Phaser.Text.prototype.updateText = function () {
368369 var lineWidths = [ ] ;
369370 var maxLineWidth = 0 ;
370371 var fontProperties = this . determineFontProperties ( this . style . font ) ;
372+
371373 for ( var i = 0 ; i < lines . length ; i ++ )
372374 {
373375 var lineWidth = this . context . measureText ( lines [ i ] ) . width ;
@@ -377,7 +379,7 @@ Phaser.Text.prototype.updateText = function () {
377379
378380 var width = maxLineWidth + this . style . strokeThickness ;
379381
380- this . canvas . width = ( width + this . context . lineWidth ) * this . resolution ;
382+ this . canvas . width = ( width + this . context . lineWidth ) * this . resolution ;
381383
382384 //calculate text height
383385 var lineHeight = fontProperties . fontSize + this . style . strokeThickness ;
@@ -386,9 +388,12 @@ Phaser.Text.prototype.updateText = function () {
386388
387389 this . canvas . height = height * this . resolution ;
388390
389- this . context . scale ( this . resolution , this . resolution ) ;
391+ this . context . scale ( this . resolution , this . resolution ) ;
390392
391- if ( navigator . isCocoonJS ) this . context . clearRect ( 0 , 0 , this . canvas . width , this . canvas . height ) ;
393+ if ( navigator . isCocoonJS )
394+ {
395+ this . context . clearRect ( 0 , 0 , this . canvas . width , this . canvas . height ) ;
396+ }
392397
393398 this . context . fillStyle = this . style . fill ;
394399 this . context . font = this . style . font ;
0 commit comments