fix: incorrectly rendering freedraw elements (#5481)

This commit is contained in:
David Luzar 2022-07-22 16:18:41 +02:00 committed by GitHub
parent 2b71a1f0bd
commit ac66665b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;