From ac66665b6472c46d0674065872a7b30a705ac336 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Fri, 22 Jul 2022 16:18:41 +0200 Subject: [PATCH] fix: incorrectly rendering freedraw elements (#5481) --- src/renderer/renderElement.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/renderElement.ts b/src/renderer/renderElement.ts index 92f48a76..e53dd698 100644 --- a/src/renderer/renderElement.ts +++ b/src/renderer/renderElement.ts @@ -752,12 +752,6 @@ export const renderElement = ( generateElementShape(element, generator); if (renderConfig.isExporting) { - const elementWithCanvas = generateElementWithCanvas( - element, - renderConfig, - ); - drawElementFromCanvas(elementWithCanvas, rc, context, renderConfig); - } else { const [x1, y1, x2, y2] = getElementAbsoluteCoords(element); const cx = (x1 + x2) / 2 + renderConfig.scrollX; const cy = (y1 + y2) / 2 + renderConfig.scrollY; @@ -769,6 +763,12 @@ export const renderElement = ( context.translate(-shiftX, -shiftY); drawElementOnCanvas(element, rc, context, renderConfig); context.restore(); + } else { + const elementWithCanvas = generateElementWithCanvas( + element, + renderConfig, + ); + drawElementFromCanvas(elementWithCanvas, rc, context, renderConfig); } break;