mirror of
https://github.com/imgfloat/server.git
synced 2026-03-23 07:10:38 +00:00
Use int values for canvas size
This commit is contained in:
@@ -216,12 +216,16 @@ async function fetchCanvasSettings() {
|
||||
}
|
||||
|
||||
async function saveCanvasSettings() {
|
||||
const width = parseFloat(elements.canvasWidth?.value) || 0;
|
||||
const height = parseFloat(elements.canvasHeight?.value) || 0;
|
||||
if (width <= 0 || height <= 0) {
|
||||
const width = Number(elements.canvasWidth?.value);
|
||||
const height = Number(elements.canvasHeight?.value);
|
||||
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
||||
showToast("Please enter a valid width and height.", "info");
|
||||
return;
|
||||
}
|
||||
if (!Number.isInteger(width) || !Number.isInteger(height)) {
|
||||
showToast("Please enter whole-number dimensions for the canvas size.", "info");
|
||||
return;
|
||||
}
|
||||
if (elements.canvasStatus) elements.canvasStatus.textContent = "Saving...";
|
||||
setButtonBusy(elements.canvasSaveButton, true, "Saving...");
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user