Skip to content

Commit a2c9c3c

Browse files
committed
Fix char right adjustment
1 parent 00e5c5f commit a2c9c3c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/gameobjects/bitmaptext/GetBitmapTextSize.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,17 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
435435

436436
if (align === 1)
437437
{
438-
currentChar.x += ((longestLine - lineWidths[currentChar.line]) / 2);
438+
var ax1 = ((longestLine - lineWidths[currentChar.line]) / 2);
439+
440+
currentChar.x += ax1;
441+
currentChar.r += ax1;
439442
}
440443
else if (align === 2)
441444
{
442-
currentChar.x += (longestLine - lineWidths[currentChar.line]);
445+
var ax2 = (longestLine - lineWidths[currentChar.line]);
446+
447+
currentChar.x += ax2;
448+
currentChar.r += ax2;
443449
}
444450
}
445451
}

0 commit comments

Comments
 (0)