Need to figure out how to resize a HTML5 Canvas element #1

paulrenenichols opened this Issue Mar 25, 2013 · 1 comment


None yet

1 participant


Can't seem to figure out how to resize a Canvas element.

This code seems to disable canvas drawing:

canvas.attr('width', gameBoardWidth);
canvas.attr('height', gameBoardWidth);


I can't tell exactly when I figured it out, but canvas.attr('width', width) seems to work for resizing.

Also note, that the canvas object is a jQuery object, so this is not a standard browser call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment