From f41f771104d4934666fb076a5f4a9f19be0e5bfb Mon Sep 17 00:00:00 2001 From: Felix Feng Date: Tue, 26 Nov 2024 21:16:24 +0800 Subject: [PATCH] fix --- .../src/registry/default/plate-ui/export-toolbar-button.tsx | 6 +++--- apps/www/src/registry/registry-ui.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/www/src/registry/default/plate-ui/export-toolbar-button.tsx b/apps/www/src/registry/default/plate-ui/export-toolbar-button.tsx index 04cd9f5283..a659a8bf70 100644 --- a/apps/www/src/registry/default/plate-ui/export-toolbar-button.tsx +++ b/apps/www/src/registry/default/plate-ui/export-toolbar-button.tsx @@ -53,10 +53,10 @@ export function ExportToolbarButton({ children, ...props }: DropdownMenuProps) { const pdfDoc = await PDFLib.PDFDocument.create(); const page = pdfDoc.addPage([canvas.width, canvas.height]); const imageEmbed = await pdfDoc.embedPng(canvas.toDataURL('PNG')); - + const { height, width } = imageEmbed.scale(1); page.drawImage(imageEmbed, { - height: canvas.height, - width: canvas.width, + height, + width, x: 0, y: 0, }); diff --git a/apps/www/src/registry/registry-ui.ts b/apps/www/src/registry/registry-ui.ts index 5b7bcf1537..5f31f9e4bc 100644 --- a/apps/www/src/registry/registry-ui.ts +++ b/apps/www/src/registry/registry-ui.ts @@ -364,6 +364,7 @@ import { withDraggables } from './withDraggables';`, 'table-dropdown-menu', 'toggle-toolbar-button', 'turn-into-dropdown-menu', + 'export-toolbar-button', ], type: 'registry:ui', },