Remove trailing spaces

This commit is contained in:
Ray
2026-03-13 18:50:26 +01:00
parent 7b9a2a4145
commit 6ba6df3af3
9 changed files with 43 additions and 43 deletions

View File

@ -797,22 +797,22 @@ EM_ASYNC_JS(void, RequestClipboardData, (void), {
{
const blob = await item.getType(item.types.find(t => t.startsWith("image/")));
const bitmap = await createImageBitmap(blob);
const canvas = document.createElement('canvas');
canvas.width = bitmap.width;
canvas.height = bitmap.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(bitmap, 0, 0);
const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
// Store image and data for the Fetch function
window._lastImgWidth = canvas.width;
window._lastImgHeight = canvas.height;
window._lastImgData = imgData;
window._lastImgData = imgData;
}
}
}
}
else console.warn("Clipboard read() requires HTTPS/Localhost");
});
@ -838,15 +838,15 @@ EM_JS(unsigned char *, GetLastPastedImage, (int *width, int *height), {
{
const ptr = _malloc(data.length);
HEAPU8.set(data, ptr);
// Set the width and height via the pointers passed from C
// HEAP32 handles the 4-byte integers
if (width) setValue(width, window._lastImgWidth, 'i32');
if (height) setValue(height, window._lastImgHeight, 'i32');
// Clear the JS buffer so there is no need to fetch the same image twice
window._lastImgData = null;
window._lastImgData = null;
return ptr;
}
}
@ -876,7 +876,7 @@ Image GetClipboardImage(void)
image.mipmaps = 1;
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
}
return image;
}