mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-02-23 11:00:03 +01:00
Linting
This commit is contained in:
parent
f72f8f67ae
commit
b6e5384945
@ -4,14 +4,7 @@
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var scope;
|
||||
if ((typeof exports) !== "undefined"){
|
||||
scope = exports;
|
||||
}
|
||||
else {
|
||||
scope = require.register("./modifiedCanvasAPI", {});
|
||||
}
|
||||
|
||||
const scope = ((typeof exports) !== "undefined")? exports: require.register("./modifiedCanvasAPI");
|
||||
const colorStatistics = require("./colorStatistics");
|
||||
const logging = require("./logging");
|
||||
const {copyCanvasToWebgl} = require("./webgl");
|
||||
@ -30,8 +23,8 @@
|
||||
var imageData;
|
||||
var source;
|
||||
if ((context.canvas.width || 0) * (context.canvas.height || 0) === 0){
|
||||
imageData = new (getWrapped(window).ImageData)(0, 0);
|
||||
source = new (getWrapped(window).ImageData)(0, 0);
|
||||
imageData = new (getWrapped(window).ImageData)(0, 0);
|
||||
source = new (getWrapped(window).ImageData)(0, 0);
|
||||
}
|
||||
else if (context instanceof window.CanvasRenderingContext2D){
|
||||
imageData = window.CanvasRenderingContext2D.prototype.getImageData.call(
|
||||
@ -42,7 +35,7 @@
|
||||
source = imageData.data;
|
||||
}
|
||||
else {
|
||||
imageData = new (getWrapped(window).ImageData)(context.canvas.width, context.canvas.height);
|
||||
imageData = new (getWrapped(window).ImageData)(context.canvas.width, context.canvas.height);
|
||||
source = new Uint8Array(imageData.data.length);
|
||||
(
|
||||
context instanceof window.WebGLRenderingContext?
|
||||
@ -152,7 +145,7 @@
|
||||
var size = canvas.height * canvas.width;
|
||||
var maxSize = prefs("maxFakeSize") || Number.POSITIVE_INFINITY;
|
||||
var minSize = prefs("minFakeSize") || 0;
|
||||
return size > minSize & size <= maxSize;
|
||||
return size > minSize && size <= maxSize;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user