Skip to content

Commit 3f76157

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents e203520 + 4b9b4c9 commit 3f76157

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCanvasRenderer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ var DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPerc
9090
ctx.save();
9191
ctx.translate(src.x, src.y);
9292
ctx.rotate(src.rotation);
93+
ctx.translate(-src.displayOriginX, -src.displayOriginY);
9394
ctx.scale(src.scaleX, src.scaleY);
9495

9596
if (src.cropWidth > 0 && src.cropHeight > 0)

src/gameobjects/bitmaptext/static/BitmapTextCanvasRenderer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage,
8787
ctx.save();
8888
ctx.translate((src.x - cameraScrollX) + src.frame.x, (src.y - cameraScrollY) + src.frame.y);
8989
ctx.rotate(src.rotation);
90+
ctx.translate(-src.displayOriginX, -src.displayOriginY);
9091
ctx.scale(src.scaleX, src.scaleY);
9192

9293
// ctx.fillStyle = 'rgba(255,0,255,0.5)';

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,9 @@ var TextureTintPipeline = new Class({
983983
continue;
984984
}
985985

986+
x -= bitmapText.displayOriginX;
987+
y -= bitmapText.displayOriginY;
988+
986989
xw = x + glyphW * scale;
987990
yh = y + glyphH * scale;
988991
tx0 = x * mva + y * mvc + mve;
@@ -1260,6 +1263,8 @@ var TextureTintPipeline = new Class({
12601263
vTintBR = getTint(vTintBR, alpha);
12611264
}
12621265

1266+
x -= bitmapText.displayOriginX;
1267+
y -= bitmapText.displayOriginY;
12631268
x *= scale;
12641269
y *= scale;
12651270
x -= cameraScrollX;

0 commit comments

Comments
 (0)