Skip to content

Commit dab806e

Browse files
committed
Can use same matrix
1 parent edc0766 commit dab806e

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/renderer/canvas/CanvasRenderer.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,6 @@ var CanvasRenderer = new Class({
634634

635635
var camMatrix = this._tempMatrix1;
636636
var spriteMatrix = this._tempMatrix2;
637-
var calcMatrix = this._tempMatrix3;
638637

639638
var cd = frame.canvasData;
640639

@@ -731,22 +730,19 @@ var CanvasRenderer = new Class({
731730
// Undo the camera scroll
732731
spriteMatrix.e = sprite.x;
733732
spriteMatrix.f = sprite.y;
734-
735-
// Multiply by the Sprite matrix, store result in calcMatrix
736-
camMatrix.multiply(spriteMatrix, calcMatrix);
737733
}
738734
else
739735
{
740736
spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX;
741737
spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY;
742-
743-
// Multiply by the Sprite matrix, store result in calcMatrix
744-
camMatrix.multiply(spriteMatrix, calcMatrix);
745738
}
746739

740+
// Multiply by the Sprite matrix
741+
camMatrix.multiply(spriteMatrix);
742+
747743
ctx.save();
748744

749-
calcMatrix.setToContext(ctx);
745+
camMatrix.setToContext(ctx);
750746

751747
ctx.globalCompositeOperation = this.blendModes[sprite.blendMode];
752748

0 commit comments

Comments
 (0)