Remove duplicate code

This commit is contained in:
Richard Davey 2020-09-23 12:06:22 +01:00
parent 5940df46fa
commit e2d775e083

View file

@ -740,19 +740,16 @@ var CanvasRenderer = new Class({
// Undo the camera scroll
spriteMatrix.e = sprite.x;
spriteMatrix.f = sprite.y;
// Multiply by the Sprite matrix, store result in calcMatrix
camMatrix.multiply(spriteMatrix, calcMatrix);
}
else
{
spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX;
spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY;
// Multiply by the Sprite matrix, store result in calcMatrix
camMatrix.multiply(spriteMatrix, calcMatrix);
}
// Multiply by the Sprite matrix, store result in calcMatrix
camMatrix.multiply(spriteMatrix, calcMatrix);
ctx.save();
calcMatrix.setToContext(ctx);