fix: svg and png frame clipping cases (#8515)

This commit is contained in:
David Luzar 2024-09-18 00:20:22 +02:00 committed by GitHub
parent e0a22edfbd
commit 44a1c8d857
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -185,6 +185,11 @@ export const exportToCanvas = async (
exportingFrame ?? null, exportingFrame ?? null,
appState.frameRendering ?? 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({ const elementsForRender = prepareElementsForRender({
elements, elements,
@ -351,6 +356,11 @@ export const exportToSvg = async (
}) rotate(${frame.angle} ${cx} ${cy})" }) rotate(${frame.angle} ${cx} ${cy})"
width="${frame.width}" width="${frame.width}"
height="${frame.height}" height="${frame.height}"
${
exportingFrame
? ""
: `rx=${FRAME_STYLE.radius} ry=${FRAME_STYLE.radius}`
}
> >
</rect> </rect>
</clipPath>`; </clipPath>`;