Fixed lint errors with PR #5193

This commit is contained in:
Richard Davey 2020-07-13 12:55:49 +01:00
parent 259b702df8
commit 6374da052f
2 changed files with 31 additions and 28 deletions

View file

@ -30,7 +30,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen
}
var transformMatrix = container.localTransform;
if (parentMatrix)
{
transformMatrix.loadIdentity();
@ -55,11 +55,12 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen
var alpha = container._alpha;
var scrollFactorX = container.scrollFactorX;
var scrollFactorY = container.scrollFactorY;
if (container.mask) {
if (container.mask)
{
container.mask.preRenderCanvas(renderer, null, camera);
}
for (var i = 0; i < children.length; i++)
{
var child = children[i];
@ -90,11 +91,11 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen
child.setAlpha(childAlpha);
child.setScrollFactor(childScrollFactorX, childScrollFactorY);
}
if (container.mask) {
if (container.mask)
{
container.mask.postRenderCanvas(renderer);
}
};
module.exports = ContainerCanvasRenderer;

View file

@ -145,7 +145,7 @@ var CanvasRenderer = new Class({
/**
* Details about the currently scheduled snapshot.
*
*
* If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered.
*
* @name Phaser.Renderer.Canvas.CanvasRenderer#snapshotState
@ -489,9 +489,9 @@ var CanvasRenderer = new Class({
/**
* Takes a snapshot of the given area of the given canvas.
*
*
* Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render.
*
*
* Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets
* more expensive the larger the canvas size gets, so please be careful how you employ this in your game.
*
@ -529,12 +529,12 @@ var CanvasRenderer = new Class({
/**
* Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered.
*
*
* To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`.
*
*
* Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then
* calling this method will override it.
*
*
* Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets
* more expensive the larger the canvas size gets, so please be careful how you employ this in your game.
*
@ -554,12 +554,12 @@ var CanvasRenderer = new Class({
/**
* Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered.
*
*
* To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`.
*
*
* Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then
* calling this method will override it.
*
*
* Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets
* more expensive the larger the canvas size gets, so please be careful how you employ this in your game.
*
@ -594,12 +594,12 @@ var CanvasRenderer = new Class({
/**
* Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered.
*
*
* To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`.
*
*
* Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then
* calling this method will override it.
*
*
* Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for
* the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute,
* using less memory.
@ -642,7 +642,7 @@ var CanvasRenderer = new Class({
// Nothing to see, so abort early
return;
}
var ctx = this.currentContext;
var camMatrix = this._tempMatrix1;
@ -676,7 +676,7 @@ var CanvasRenderer = new Class({
frameWidth = crop.cw;
frameHeight = crop.ch;
frameX = crop.cx;
frameY = crop.cy;
@ -694,7 +694,7 @@ var CanvasRenderer = new Class({
x = (Math.abs(x) - frameWidth);
}
}
if (sprite.flipY)
{
if (y >= 0)
@ -752,13 +752,13 @@ var CanvasRenderer = new Class({
{
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);
}
ctx.save();
calcMatrix.setToContext(ctx);
ctx.globalCompositeOperation = this.blendModes[sprite.blendMode];
@ -766,17 +766,19 @@ var CanvasRenderer = new Class({
ctx.globalAlpha = alpha;
ctx.imageSmoothingEnabled = !(!this.antialias || frame.source.scaleMode);
if (sprite.mask) {
if (sprite.mask)
{
sprite.mask.preRenderCanvas(this, sprite, camera);
}
ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res);
if (sprite.mask) {
if (sprite.mask)
{
sprite.mask.postRenderCanvas(this, sprite, camera);
}
ctx.restore();
},