Skip to content

Commit

Permalink
tentative de regler un bug sur telephone de refresh intempestif
Browse files Browse the repository at this point in the history
  • Loading branch information
ChevalMonsieur committed Oct 5, 2023
1 parent b18f355 commit 343925c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
14 changes: 8 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ function draw() {
}

function windowResized() {
// get new div size
mainWidth = document.getElementById("main").clientWidth;
mainHeight = document.getElementById("setterCanvaHeight").clientHeight + 25; // + 25 is a manual offset to make canvas slightly bigger than the sidebar
if (mainWidth != document.getElementById("main").clientWidth) { // check that it is not only the height that changed (we don't care in this case)
// get new div size
mainWidth = document.getElementById("main").clientWidth;
mainHeight = document.getElementById("setterCanvaHeight").clientHeight + 25; // + 25 is a manual offset to make canvas slightly bigger than the sidebar

// resize canvas to correct size
resizeCanvas(mainWidth, mainHeight);
// resize canvas to correct size
resizeCanvas(mainWidth, mainHeight);

reset();
reset();
}
}

function reset() {
Expand Down
7 changes: 0 additions & 7 deletions noiseTest.svg

This file was deleted.

0 comments on commit 343925c

Please sign in to comment.