From aa7f2673d124d1d35b3cd6ef0339e717d758344c Mon Sep 17 00:00:00 2001 From: Nic Limper Date: Fri, 5 Apr 2024 12:00:19 +0200 Subject: [PATCH] Revert "Fixed drag and drop image resizing." --- ESP32_AP-Flasher/wwwroot/main.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ESP32_AP-Flasher/wwwroot/main.js b/ESP32_AP-Flasher/wwwroot/main.js index a753f77c..f62daa42 100644 --- a/ESP32_AP-Flasher/wwwroot/main.js +++ b/ESP32_AP-Flasher/wwwroot/main.js @@ -64,9 +64,9 @@ window.addEventListener("loadConfig", function () { if (data.hasBLE == 0) { $("#apcfgble").parentNode.style.display = 'none'; } - if (data.hasSubGhz == 0) { - $("#apcfgsubgigchid").parentNode.style.display = 'none'; - } + if (data.hasSubGhz == 0) { + $("#apcfgsubgigchid").parentNode.style.display = 'none'; + } if (data.savespace) { } if (data.apstate) { @@ -1472,7 +1472,7 @@ function dropUpload() { const canvas = createCanvas(width, height); const ctx = canvas.getContext('2d'); - const scaleFactor = Math.min( + const scaleFactor = Math.max( canvas.width / image.width, canvas.height / image.height ); @@ -1483,8 +1483,6 @@ function dropUpload() { const x = (canvas.width - newWidth) / 2; const y = (canvas.height - newHeight) / 2; - ctx.fillStyle = "white"; - ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.drawImage(image, x, y, newWidth, newHeight); canvas.toBlob(async (blob) => {