1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 12:50:36 +01:00

Fix optional parameter

Fixes #302
This commit is contained in:
kkapsner 2018-12-30 22:22:10 +01:00
parent 7a838b2e79
commit b4b6fcdd13

View File

@ -373,7 +373,7 @@
if ((typeof originalValue) === "boolean"){
notify("fakedReadout");
var index = x + this.width * y;
return original.call(this, rng(x, index), rng(y, index));
return original.call(this, rng(x, index), rng(y, index), args[2]);
}
else {
return originalValue;
@ -399,8 +399,17 @@
var originalValue = original.apply(this, window.Array.from(args));
if ((typeof originalValue) === "boolean"){
notify("fakedReadout");
var index = x + this.width * y;
return original.call(this, rng(x, index), rng(y, index));
if (x instanceof window.Path2D){
let path = x;
x = y;
y = args[2];
let index = x + this.width * y;
return original.call(this, path, rng(x, index), rng(y, index));
}
else {
let index = x + this.width * y;
return original.call(this, rng(x, index), rng(y, index));
}
}
else {
return originalValue;