File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
274274* Removed use of the deprecated ` enterFullScreen ` and ` leaveFullScreen ` signals from the Scale Manager (thanks @mmanlod #1972 )
275275* BitmapText with tints applied wouldn't update properly in Canvas mode (thanks @Pajamaman #1969 )
276276* Group.cacheAsBitmap would be incorrectly offset in Canvas mode (thanks @mkristo #1925 )
277-
277+ * Text.setTextBounds didn't add the x and y values to the width and height offsets.
278278
279279For changes in previous releases please see the extensive [ Version History] ( https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md ) .
280280
Original file line number Diff line number Diff line change @@ -1129,20 +1129,20 @@ Phaser.Text.prototype.updateTexture = function () {
11291129 // Align the canvas based on the bounds
11301130 if ( this . style . boundsAlignH === 'right' )
11311131 {
1132- x = this . textBounds . width - this . canvas . width ;
1132+ x + = this . textBounds . width - this . canvas . width ;
11331133 }
11341134 else if ( this . style . boundsAlignH === 'center' )
11351135 {
1136- x = this . textBounds . halfWidth - ( this . canvas . width / 2 ) ;
1136+ x + = this . textBounds . halfWidth - ( this . canvas . width / 2 ) ;
11371137 }
11381138
11391139 if ( this . style . boundsAlignV === 'bottom' )
11401140 {
1141- y = this . textBounds . height - this . canvas . height ;
1141+ y + = this . textBounds . height - this . canvas . height ;
11421142 }
11431143 else if ( this . style . boundsAlignV === 'middle' )
11441144 {
1145- y = this . textBounds . halfHeight - ( this . canvas . height / 2 ) ;
1145+ y + = this . textBounds . halfHeight - ( this . canvas . height / 2 ) ;
11461146 }
11471147
11481148 this . pivot . x = - x ;
You can’t perform that action at this time.
0 commit comments