1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 12:36:37 +02:00

respect RFP setting in isPointInPath and isPointInStroke

Fixes #189
This commit is contained in:
kkapsner 2018-05-26 15:36:55 +02:00
parent f02246128e
commit 52e44e0eb2
4 changed files with 44 additions and 15 deletions

View file

@ -316,9 +316,14 @@
return function isPointInPath(x, y){
var rng = randomSupply.getRng(1, window);
var originalValue = original.apply(this, window.Array.from(arguments));
var value = rng(originalValue, x + this.width * y);
notify.call(this, "fakedReadout");
return !!(value & 1);
if ((typeof originalValue) === "boolean"){
notify.call(this, "fakedReadout");
var index = x + this.width * y;
return original.call(this, rng(x, index), rng(y, index));
}
else {
return originalValue;
}
};
}
},
@ -334,9 +339,14 @@
return function isPointInStroke(x, y){
var rng = randomSupply.getRng(1, window);
var originalValue = original.apply(this, window.Array.from(arguments));
var value = rng(originalValue, x + this.width * y);
notify.call(this, "fakedReadout");
return !!(value & 1);
if ((typeof originalValue) === "boolean"){
notify.call(this, "fakedReadout");
var index = x + this.width * y;
return original.call(this, rng(x, index), rng(y, index));
}
else {
return originalValue;
}
};
}
},