Skip to content

Commit

Permalink
berf
Browse files Browse the repository at this point in the history
  • Loading branch information
loglot authored Sep 1, 2023
1 parent 03c3efe commit 30f753a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ var scaleY = 0;

function resizeCanvasForWindowSize() {

const currentWidth = canvas.width;
const currentHeight = canvas.height;
var currentWidth = canvas.width;
var currentHeight = canvas.height;

// Get the current window dimensions
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;

// Calculate the desired width and height based on the window's dimensions

const desiredWidth = windowWidth;
const aspectRatio = originalWidth / originalHeight;
const desiredHeight = desiredWidth / aspectRatio;
var desiredWidth = windowWidth;
var aspectRatio = originalWidth / originalHeight;
var desiredHeight = desiredWidth / aspectRatio;
canvas.width = desiredWidth;
canvas.height = desiredHeight;
scaleX = (desiredWidth / originalWidth);
Expand Down

0 comments on commit 30f753a

Please sign in to comment.