Skip to content

Commit 4b9b4c9

Browse files
committed
Dynamic BitmapText's origin is used on rendering the text
1 parent 41bcaba commit 4b9b4c9

2 files changed

Lines changed: 3 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/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,8 @@ var TextureTintPipeline = new Class({
12631263
vTintBR = getTint(vTintBR, alpha);
12641264
}
12651265

1266+
x -= bitmapText.displayOriginX;
1267+
y -= bitmapText.displayOriginY;
12661268
x *= scale;
12671269
y *= scale;
12681270
x -= cameraScrollX;

0 commit comments

Comments
 (0)