mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 18:42:00 +01:00
added isPointInPath and isPointInStroke to the readout-API list
This commit is contained in:
parent
6f8f9a7e9c
commit
a7e472f298
@ -304,6 +304,42 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isPointInPath: {
|
||||||
|
type: "readout",
|
||||||
|
getStatus: function(obj, status){
|
||||||
|
status = Object.create(status);
|
||||||
|
status.active = hasType(status, "readout");
|
||||||
|
return status;
|
||||||
|
},
|
||||||
|
object: "CanvasRenderingContext2D",
|
||||||
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isPointInStroke: {
|
||||||
|
type: "readout",
|
||||||
|
getStatus: function(obj, status){
|
||||||
|
status = Object.create(status);
|
||||||
|
status.active = hasType(status, "readout");
|
||||||
|
return status;
|
||||||
|
},
|
||||||
|
object: "CanvasRenderingContext2D",
|
||||||
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
fillText: {
|
fillText: {
|
||||||
type: "input",
|
type: "input",
|
||||||
getStatus: function(obj, status){
|
getStatus: function(obj, status){
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Version 0.4.5:
|
Version 0.4.5:
|
||||||
changes:
|
changes:
|
||||||
-
|
- added isPointInPath and isPointInStroke to the readout-API list
|
||||||
|
|
||||||
new features:
|
new features:
|
||||||
- Added way to inspect canvas content in ask mode while being asked
|
- Added way to inspect canvas content in ask mode while being asked
|
||||||
|
Loading…
x
Reference in New Issue
Block a user