From c66155e9331782c451066ab28a933e3062532c00 Mon Sep 17 00:00:00 2001 From: w Date: Wed, 16 Jul 2025 23:43:35 -0300 Subject: [PATCH] Optimize card drawing function and enhance image download quality --- web/templates/card_creator.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/templates/card_creator.html b/web/templates/card_creator.html index 47c3c48..6483cbf 100644 --- a/web/templates/card_creator.html +++ b/web/templates/card_creator.html @@ -123,8 +123,7 @@ frameSelect.addEventListener("change", updateFrame); function drawCard() { ctx.clearRect(0, 0, canvas.width, canvas.height); - ctx.fillStyle = "#f5f5f5"; - ctx.fillRect(0, 0, canvas.width, canvas.height); + // Draw uploaded art as background if present if (uploadedImage) { @@ -201,7 +200,7 @@ function wrapText(text, x, y, maxWidth, lineHeight) { downloadBtn.addEventListener("click", () => { const link = document.createElement("a"); link.download = "kemoverse-card.webp"; - link.href = canvas.toDataURL("image/webp"); + link.href = canvas.toDataURL("image/webp", 0.95); link.click(); });