Razão do conjunto de tela CSS

canvas.width = canvas.height * (canvas.clientWidth / canvas.clientHeight);
Friendly Hawk