Firefox throwing a exception with HTML Canvas putImageData

前端 未结 7 945
Happy的楠姐
Happy的楠姐 2021-01-04 09:12

So I was working on this little javascript experiment and I needed a widget to track the FPS of it. I ported a widget I\'ve been using with Actionscript 3 to Javascript and

7条回答
  •  不知归路
    2021-01-04 10:03

    I've been dealing with this issue for a few days now (in firefox). The best idea I could come up with is to dynamically remove the pixels that are going off the screen. I'm worried that it will take too much cpu to do this. hopefully someone comes up with a better idea :/

    but to reiterate, I've only seen this error when putImageData is trying to draw ANY pixel outside of the canvas perimeter. eg. any x or y value < 0.

    -- on second read -- It looks like you're already resizing your image data. You might try sizing your image down to 68px if you're in a 70px container? Probably won't work, but worth a try..

提交回复
热议问题