javascript - canvas data out of range? problem in FF -


i run code every frame, works great in chrome

data[index + 0] = bgdata[dis + 0]; data[index + 1] = bgdata[dis + 1]; data[index + 2] = bgdata[dis + 2]; data[index + 3] = 255; 

but firefox gives error:

an invalid or illegal string specified" code: "12

unless add -1 each line below:

data[index + 0] = bgdata[dis + 0] -1; data[index + 1] = bgdata[dis + 1] -1; data[index + 2] = bgdata[dis + 2] -1; data[index + 3] = 255; 

any ideas why might happen? trying optimize code as possible, , understand! data shouldn't out of range obtained by:

bgdata = backgroundcanvasctx.getimagedata(mx, 0, 320, 400).data; 

update line causes error is:

overlayimagecanvasctx.putimagedata(imgdata, 0, 0);  


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -