From ab5effc3a014d9c391e278102b24a49077e54e3b Mon Sep 17 00:00:00 2001 From: Andreas Grasser Date: Mon, 28 Nov 2022 20:46:19 +0100 Subject: [PATCH] ... --- image.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/image.js b/image.js index 4334671..a8e2713 100644 --- a/image.js +++ b/image.js @@ -4,11 +4,11 @@ const dist = [200, 330, 450]; const numb = [8, 15, 26]; const radius = [64,58,50]; let userNum = 0; -let remainingImg = 1; +let remainingImg = 0; function render(users) { userNum = 0; - remainingImg = 1; + remainingImg = 0; const canvas = document.getElementById("canvas"); const ctx = canvas.getContext("2d"); @@ -90,8 +90,7 @@ function loadImage(ctx, url, x, y, r) { ctx.restore(); remainingImg -= 1; - console.log(remainingImg); - if (remainingImg == 0) { + if (remainingImg <= 0) { document.getElementById("btn_download").href = document.getElementById("canvas").toDataURL("image/png;base64") document.getElementById("btn_download").style.display = "inline"; }