Canvas issues within a WebView in react native [pending]

1

Why changing the height > 100 and width > 640 on the canvas inside a WebView in react native, nothing else and drawing?

//funciona 
...
canvas.width  = 640;
canvas.height = 100;
ctx.drawImage(img, 0, 0);
...

//não  funciona 
...
canvas.width  = 1024;
canvas.height = 768;
ctx.drawImage(img, 0, 0);
...
    
asked by anonymous 10.12.2018 / 02:59

1 answer

1

I was able to resolve by changing the dimensions at the end of the DOM load, as in the example below.

window.onload = () => {
   canvas.width  = 1024;
   canvas.height = 768;
   ctx.drawImage(img, 0, 0);
   // ...
}
    
11.12.2018 / 12:53