Skip to content

Commit

Permalink
update offset on window.resize
Browse files Browse the repository at this point in the history
  • Loading branch information
espmaniac authored Nov 26, 2024
1 parent 4f83559 commit 52e52ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,12 @@ canvas.addEventListener("touchend", function(event) {
});

window.onresize = function() {
offsetX += (window.innerWidth - canvas.width) / 2 / zoom;
offsetY += (window.innerHeight - canvas.height) / 2 / zoom;

canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

renderAll();
};

Expand Down

0 comments on commit 52e52ba

Please sign in to comment.