You cannot draw on canvas of a certain size

For some reason, if the second canvas in the following code is more than 526 pixels high, this will not be displayed in Chrome. It works fine as long as the height is <527, and always works in Firefox. Does anyone know what I'm doing wrong? I am very new to HTML, so sorry if I missed something.

<!doctype html> <html> <head> <script type="text/javascript"> function init() { var canv = document.getElementById("myCanvas"); var ctx = canv.getContext("2d"); ctx.fillStyle = "red"; ctx.fillRect(0, 0, canv.width, canv.height); } </script> <style type="text/css"> canvas {border: 1px solid black; } </style> </head> <body onload="init()"> <canvas id="mainFrame" width="700" height="700"></canvas> <canvas id="myCanvas" width="125" height="527"></canvas> <!-- cannot exceed 526 ... WHY? --> </body> </html> 
+4
source share
1 answer

I tried this on my chrome v.24.0.1312 on win7 x64 and it works as it is, try upgrading to the latest browser version.

+1
source

All Articles