you cannot set #thecanvas
width and height by percentage in CSS ... it does makes you lose aspect ratio.
#thecanvas { width:80%; height:80%;
...
Instead use inline html attribute or set it with jquery, this way you keep aspect ratio.
<canvas id="thecanvas" width="600" height="800"></canvas>
or
$('#thecanvas').width(...).height(...)