Update pixelResizeTool.js

This commit is contained in:
feeshmaster 2023-11-25 20:32:07 -06:00 committed by GitHub
parent 02243ac3fb
commit 4bb3b2c9ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ pixelResizeButton.onclick = function(pixel) {
let canvas_width = document.getElementById("game").width;
let canvas_height = document.getElementById("game").height;
let pixelSizeNeeded = prompt("How big should pixels be?");
if (!pixelSizeNeeded) { return }
if (!pixelSizeNeeded || isNAN(pixelSizeNeeded)) { alert('number is invalid!'); return; }
resizeCanvas(canvas_height,canvas_width, parseFloat(pixelSizeNeeded), true);
};
pixelResizeButton.textContent = "Resize";