From cb3bb056aa1032538a1ba24ae5d5812b8eab487b Mon Sep 17 00:00:00 2001 From: JuhyunLim <87933367+userJu@users.noreply.github.com> Date: Thu, 8 Jun 2023 21:29:34 +0900 Subject: [PATCH 1/2] Feat: Add setAttribute in canvas element --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 2de59a30..0e22bc41 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,6 +47,10 @@ export async function toCanvas( } canvas.style.width = `${canvasWidth}` canvas.style.height = `${canvasHeight}` + canvas.setAttribute('width', `${canvasWidth}`) + canvas.setAttribute('height', `${canvasHeight}`) + console.log(canvas) + if (options.backgroundColor) { context.fillStyle = options.backgroundColor From 9673188ab391df9f8a3db207ba855a2fd06a1cbe Mon Sep 17 00:00:00 2001 From: JuhyunLim <87933367+userJu@users.noreply.github.com> Date: Fri, 9 Jun 2023 08:55:19 +0900 Subject: [PATCH 2/2] style: delete console log --- src/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0e22bc41..1d29703d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,10 +47,8 @@ export async function toCanvas( } canvas.style.width = `${canvasWidth}` canvas.style.height = `${canvasHeight}` - canvas.setAttribute('width', `${canvasWidth}`) + canvas.setAttribute('width', `${canvasWidth}`) canvas.setAttribute('height', `${canvasHeight}`) - console.log(canvas) - if (options.backgroundColor) { context.fillStyle = options.backgroundColor