Optimize card drawing function and enhance image download quality
This commit is contained in:
parent
be998ba928
commit
c66155e933
1 changed files with 2 additions and 3 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue