From e2d775e083f1ac47db1ca9c8d9d050f16382fd06 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Wed, 23 Sep 2020 12:06:22 +0100 Subject: [PATCH] Remove duplicate code --- src/renderer/canvas/CanvasRenderer.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/renderer/canvas/CanvasRenderer.js b/src/renderer/canvas/CanvasRenderer.js index e9f5b6e64..f3ad5fc12 100644 --- a/src/renderer/canvas/CanvasRenderer.js +++ b/src/renderer/canvas/CanvasRenderer.js @@ -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);