mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
The Multi Pipeline batchSprite
and batchTexture
methods will now apply Math.floor
to the sprite matrix calculations if camera round pixels is enabled.
This commit is contained in:
parent
ccf09b3019
commit
d12b51cb48
1 changed files with 12 additions and 0 deletions
|
@ -372,6 +372,12 @@ var MultiPipeline = new Class({
|
|||
var gx = gameObject.x;
|
||||
var gy = gameObject.y;
|
||||
|
||||
if (camera.roundPixels)
|
||||
{
|
||||
gx = Math.floor(gx);
|
||||
gy = Math.floor(gy);
|
||||
}
|
||||
|
||||
spriteMatrix.applyITRS(gx, gy, gameObject.rotation, gameObject.scaleX * flipX, gameObject.scaleY * flipY);
|
||||
|
||||
camMatrix.copyFrom(camera.matrix);
|
||||
|
@ -550,6 +556,12 @@ var MultiPipeline = new Class({
|
|||
y += srcHeight;
|
||||
}
|
||||
|
||||
if (camera.roundPixels)
|
||||
{
|
||||
srcX = Math.floor(srcX);
|
||||
srcY = Math.floor(srcY);
|
||||
}
|
||||
|
||||
spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY);
|
||||
|
||||
camMatrix.copyFrom(camera.matrix);
|
||||
|
|
Loading…
Reference in a new issue