Optimize card drawing function and enhance image download quality

This commit is contained in:
w 2025-07-16 23:43:35 -03:00
parent be998ba928
commit c66155e933

View file

@ -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();
});
</script>