I want my canvas to be 53% of the width of the window, and to resize vertically, keeping the correct aspect ratio.
I tried changing the code in the html file, but it doesn't want to listen - it just keeps resetting to full size.
- Code: Select all
var theCanvas = document.getElementById("c2canvas");
var theWidth = window.innerWidth * .53;
var theHeight = theWidth * 224/256;