mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
If you apply setSize
to the Dynamic BitmapText the scissor is now calculated based on the parent transforms, not just the local ones, meaning you can crop Bitmap Text objects that exist within Containers. Fix #4653
This commit is contained in:
parent
c12eb98c49
commit
47a62cd30c
1 changed files with 14 additions and 14 deletions
|
@ -36,20 +36,6 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce
|
|||
|
||||
renderer.setPipeline(pipeline, src);
|
||||
|
||||
var crop = (src.cropWidth > 0 || src.cropHeight > 0);
|
||||
|
||||
if (crop)
|
||||
{
|
||||
pipeline.flush();
|
||||
|
||||
renderer.pushScissor(
|
||||
src.x,
|
||||
src.y,
|
||||
src.cropWidth * src.scaleX,
|
||||
src.cropHeight * src.scaleY
|
||||
);
|
||||
}
|
||||
|
||||
var camMatrix = pipeline._tempMatrix1;
|
||||
var spriteMatrix = pipeline._tempMatrix2;
|
||||
var calcMatrix = pipeline._tempMatrix3;
|
||||
|
@ -80,6 +66,20 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce
|
|||
camMatrix.multiply(spriteMatrix, calcMatrix);
|
||||
}
|
||||
|
||||
var crop = (src.cropWidth > 0 || src.cropHeight > 0);
|
||||
|
||||
if (crop)
|
||||
{
|
||||
pipeline.flush();
|
||||
|
||||
renderer.pushScissor(
|
||||
calcMatrix.tx,
|
||||
calcMatrix.ty,
|
||||
src.cropWidth * calcMatrix.scaleX,
|
||||
src.cropHeight * calcMatrix.scaleY
|
||||
);
|
||||
}
|
||||
|
||||
var frame = src.frame;
|
||||
var texture = frame.glTexture;
|
||||
var textureX = frame.cutX;
|
||||
|
|
Loading…
Reference in a new issue