Gotcha - Html5 Canvas Acting Weird?

This could burn a little time if you're not careful.

The height/width attributes are used for the coordinate system of the canvas, while the css height/width properties are for the window itself.  If the height/width attributes are not set, then they default to 300 and 150, respectively.  The bottom line is that you should probably deal with these two height/width entities separately.

Here's one nice example on stackoverflow demonstrating the issue.  Here's another one.



No comments:

Post a Comment

Popular Posts