If you change this line:
<canvas id=c1 style="width:400;height:400">
in
<canvas id=c1 width=400 height=400></canvas>
he should work. Do not use CSS to set Canvas sizes, as this affects only the element, but not the bitmap. For a canvas, you need to use its selected properties (width / height) to also set the size of the bitmap, or the bitmap is simply stretched / scaled according to the size of the element.
, , 300x150 . ( ) 400x400, .