From 44a1c8d8573c26ba5cb3d63a8e97ca9699971d2d Mon Sep 17 00:00:00 2001 From: David Luzar <5153846+dwelle@users.noreply.github.com> Date: Wed, 18 Sep 2024 00:20:22 +0200 Subject: [PATCH] fix: svg and png frame clipping cases (#8515) --- packages/excalidraw/scene/export.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/excalidraw/scene/export.ts b/packages/excalidraw/scene/export.ts index b120d0cc9e31..6d1b963fcc37 100644 --- a/packages/excalidraw/scene/export.ts +++ b/packages/excalidraw/scene/export.ts @@ -185,6 +185,11 @@ export const exportToCanvas = async ( exportingFrame ?? null, appState.frameRendering ?? null, ); + // for canvas export, don't clip if exporting a specific frame as it would + // clip the corners of the content + if (exportingFrame) { + frameRendering.clip = false; + } const elementsForRender = prepareElementsForRender({ elements, @@ -351,6 +356,11 @@ export const exportToSvg = async ( }) rotate(${frame.angle} ${cx} ${cy})" width="${frame.width}" height="${frame.height}" + ${ + exportingFrame + ? "" + : `rx=${FRAME_STYLE.radius} ry=${FRAME_STYLE.radius}` + } > `;