1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-11-04 20:28:52 +01:00

Removed bug with inproper calls (i.e. float point numbers for sw or sh) to getImageData().

This commit is contained in:
kkapsner 2015-09-02 23:57:31 +02:00
parent 4ed4bb759b
commit 98a15ef9f2

View File

@ -166,6 +166,8 @@
mode: blockMode.readAPI, mode: blockMode.readAPI,
object: unsafeWindow.CanvasRenderingContext2D, object: unsafeWindow.CanvasRenderingContext2D,
fake: function getImageData(sx, sy, sw, sh){ fake: function getImageData(sx, sy, sw, sh){
sw = parseInt(sw, 10);
sh = parseInt(sh, 10);
var l = sw * sh * 4; var l = sw * sh * 4;
var data = new Uint8ClampedArray(l); var data = new Uint8ClampedArray(l);
for (var i = 0; i < l; i += 1){ for (var i = 0; i < l; i += 1){